public void ShouldGenerateAddUrl() { PersonGroupPersonFaceRequestGenerator .Add("default", Guid.Empty.ToString(), "https://image.url") .Should() .MatchSnapshot(); }
public void ShouldGenerateAddUrlWithAttributes() { PersonGroupPersonFaceRequestGenerator .Add("default", Guid.Empty.ToString(), "https://image.url", FaceRequestGenerator.DefaultDetectionModel, @"{""image"":""data""}") .Should() .MatchSnapshot(); }
public void ShouldGenerateAddBinary() { PersonGroupPersonFaceRequestGenerator .Add("default", Guid.Empty.ToString(), new byte[0]) .Should() .MatchSnapshot(); }
public override async Task OnInitializedAsync() { Error = string.Empty; await base.OnInitializedAsync().ConfigureAwait(false); if (string.IsNullOrWhiteSpace(PersonGroupId)) { Error = "Person group ID not set!"; } if (string.IsNullOrWhiteSpace(PersonId)) { Error = "Person ID not set!"; } if (!string.IsNullOrWhiteSpace(Error)) { _personRequest = PersonGroupPersonRequestGenerator.Get("group-id", Guid.Empty.ToString()); _addFaceRequest = PersonGroupPersonFaceRequestGenerator.Add("group-id", Guid.Empty.ToString(), "http://image.url"); _addFaceRequest = PersonGroupPersonFaceRequestGenerator.Add("group-id", Guid.Empty.ToString(), new byte[0]); _addFaceRequest = PersonGroupPersonFaceRequestGenerator.Get("group-id", Guid.Empty.ToString(), Guid.Empty.ToString()); _addFaceRequest = PersonGroupPersonFaceRequestGenerator.Update("group-id", Guid.Empty.ToString(), Guid.Empty.ToString(), @"{""user"":""data""}"); _addFaceRequest = PersonGroupPersonFaceRequestGenerator.Delete("group-id", Guid.Empty.ToString(), Guid.Empty.ToString()); UpdateRequestList(); return; } string groupId = PersonGroupId !; string personId = PersonId !; _personRequest = PersonGroupPersonRequestGenerator.Get(groupId, personId); _addFaceRequest = PersonGroupPersonFaceRequestGenerator.Add(groupId, personId, "http://image.url"); _addBinaryFaceRequest = PersonGroupPersonFaceRequestGenerator.Add(groupId, personId, new byte[0]); _getFaceRequest = PersonGroupPersonFaceRequestGenerator.Get(groupId, personId, Guid.Empty.ToString()); _updateFaceRequest = PersonGroupPersonFaceRequestGenerator.Update(groupId, personId, Guid.Empty.ToString(), @"{""user"":""data""}"); _deleteFaceRequest = PersonGroupPersonFaceRequestGenerator.Delete(groupId, personId, Guid.Empty.ToString()); UpdateRequestList(); await GetPerson().ConfigureAwait(false); }