public async Task TestMatchUIViewDetails() { GenerateUIResponse uiResponse = null; Assert.DoesNotThrowAsync(async() => { MatchResponseValue matchResponse = (await Client.Match(_resumeIndexId, _documentId, _resumesIndexes)).Value; uiResponse = await Client.UI().ViewDetails(matchResponse, matchResponse.Matches[0].Id, IndexType.Resume, null); Assert.That(await DoesURLExist(uiResponse.URL)); }); Assert.DoesNotThrowAsync(async() => { BimetricScoreResponse scoreResponse = await Client.BimetricScore(BimetricScoringTests.TestParsedJobWithId, new List <ParsedResumeWithId>() { BimetricScoringTests.TestParsedResumeWithId }); uiResponse = await Client.UI().ViewDetails(scoreResponse.Value, BimetricScoringTests.TestParsedResumeWithId, IndexType.Job, null); Assert.That(await DoesURLExist(uiResponse.URL)); }); Assert.DoesNotThrowAsync(async() => { BimetricScoreResponse scoreResponse = await Client.BimetricScore(BimetricScoringTests.TestParsedResumeWithId, new List <ParsedJobWithId>() { BimetricScoringTests.TestParsedJobWithId }); uiResponse = await Client.UI().ViewDetails(scoreResponse.Value, BimetricScoringTests.TestParsedJobWithId, IndexType.Resume, null); Assert.That(await DoesURLExist(uiResponse.URL)); }); await Task.CompletedTask; }
public async Task TestMatchResume() { Assert.ThrowsAsync <SovrenException>(async() => { await Client.Match(TestParsedResume, null); }); Assert.DoesNotThrow(() => { MatchResponseValue matchResponse = Client.Match(TestParsedResume, _jobsIndexes).Result.Value; Assert.AreEqual(1, matchResponse.CurrentCount); Assert.AreEqual(1, matchResponse.TotalCount); Assert.AreEqual(1, matchResponse.Matches.Count); }); Assert.DoesNotThrow(() => { MatchResponseValue matchResponse = Client.Match(TestParsedResume, _resumesIndexes).Result.Value; Assert.AreEqual(1, matchResponse.CurrentCount); Assert.AreEqual(1, matchResponse.TotalCount); Assert.AreEqual(1, matchResponse.Matches.Count); }); await Task.CompletedTask; }
/// <summary> /// Create a Matching UI session to view a single result from an AI Matching API response /// </summary> /// <param name="sovClient">The SovrenClient</param> /// <param name="matchResponse">The AI Matching API response containing the result you want to view</param> /// <param name="matchId">The id of the specific result in the result set that you want to view</param> /// <param name="sourceDocType">The type of document this result was scored against</param> /// <param name="htmlDocument">Optionally, the HTML resume/job to display in the details view</param> /// <exception cref="SovrenException">Thrown when an API error occurs</exception> public static async Task <GenerateUIResponse> ViewDetails( this SovrenClientWithUI sovClient, MatchResponseValue matchResponse, string matchId, Models.Matching.IndexType sourceDocType, string htmlDocument = null) { AIMatchDetails details = new AIMatchDetails { Result = matchResponse.Matches.Single(m => m.Id == matchId), AppliedCategoryWeights = matchResponse.AppliedCategoryWeights, SourceDocumentType = sourceDocType, HtmlDocument = htmlDocument }; UIMatchDetailsRequest uiRequest = new UIMatchDetailsRequest(details, sovClient.UISessionOptions?.UIOptions); return(await sovClient.InternalClient.UIViewDetails(uiRequest)); }
public async Task TestMatchIndexedDocument() { Assert.ThrowsAsync <ArgumentException>(async() => { await Client.Match("", null, null); }); Assert.ThrowsAsync <ArgumentException>(async() => { await Client.Match(null, _documentId, _resumesIndexes); }); Assert.ThrowsAsync <ArgumentException>(async() => { await Client.Match("", _documentId, _resumesIndexes); }); Assert.ThrowsAsync <ArgumentException>(async() => { await Client.Match(" ", _documentId, _resumesIndexes); }); Assert.ThrowsAsync <ArgumentException>(async() => { await Client.Match(_resumeIndexId, null, _resumesIndexes);; }); Assert.ThrowsAsync <ArgumentException>(async() => { await Client.Match(_resumeIndexId, "", _resumesIndexes);; }); Assert.ThrowsAsync <ArgumentException>(async() => { await Client.Match(_resumeIndexId, " ", _resumesIndexes);; }); Assert.ThrowsAsync <SovrenException>(async() => { await Client.Match(_resumeIndexId, _documentId, null);; }); Assert.ThrowsAsync <SovrenException>(async() => { await Client.Match(_resumeIndexId, _documentId, new List <string>());; }); Assert.DoesNotThrow(() => { MatchResponseValue matchResponse = Client.Match(_resumeIndexId, _documentId, _resumesIndexes).Result.Value; Assert.AreEqual(1, matchResponse.CurrentCount); Assert.AreEqual(1, matchResponse.TotalCount); Assert.AreEqual(1, matchResponse.Matches.Count); }); Assert.DoesNotThrow(() => { MatchResponseValue matchResponse = Client.Match(_resumeIndexId, _documentId, _jobsIndexes).Result.Value; Assert.AreEqual(1, matchResponse.CurrentCount); Assert.AreEqual(1, matchResponse.TotalCount); Assert.AreEqual(1, matchResponse.Matches.Count); }); Assert.DoesNotThrow(() => { MatchResponseValue matchResponse = Client.Match(_jobIndexId, _documentId, _resumesIndexes).Result.Value; Assert.AreEqual(1, matchResponse.CurrentCount); Assert.AreEqual(1, matchResponse.TotalCount); Assert.AreEqual(1, matchResponse.Matches.Count); }); Assert.DoesNotThrow(() => { MatchResponseValue matchResponse = Client.Match(_jobIndexId, _documentId, _jobsIndexes).Result.Value; Assert.AreEqual(1, matchResponse.CurrentCount); Assert.AreEqual(1, matchResponse.TotalCount); Assert.AreEqual(1, matchResponse.Matches.Count); }); await Task.CompletedTask; }