public async Task GetCase_ShouldCall_Verint_retrieveOrganisationAsync() { // Arrange var caseDetails = new retrieveCaseDetailsResponse { FWTCaseFullDetails = CreateBaseCase() }; caseDetails.FWTCaseFullDetails.Interactions = new[] { new FWTInteractionDetails { PartyID = new FWTObjectID { ObjectReference = new [] { "test" }, ObjectType = "D1" } } }; _mockClient .Setup(client => client.retrieveCaseDetailsAsync(It.IsAny <FWTCaseFullDetailsRequest>())) .ReturnsAsync(caseDetails); // Act await _caseService.GetCase("baseCase1"); // Assert _mockClient.Verify(client => client.retrieveOrganisationAsync(It.IsAny <FWTObjectID>()), Times.Once); }
public async Task GetCase_ShouldReturnMappedIndividual() { // Arrange var caseDetails = new retrieveCaseDetailsResponse { FWTCaseFullDetails = CreateBaseCase() }; caseDetails.FWTCaseFullDetails.Interactions = new[] { new FWTInteractionDetails { PartyID = new FWTObjectID { ObjectReference = new [] { "test" }, ObjectType = "C1" } } }; var individualDetails = new retrieveIndividualResponse { FWTIndividual = new FWTIndividual { Name = new[] { new FWTIndividualName { Forename = new [] { "test" }, Surname = "test" } } } }; _mockClient .Setup(client => client.retrieveCaseDetailsAsync(It.IsAny <FWTCaseFullDetailsRequest>())) .ReturnsAsync(caseDetails); _mockClient .Setup(client => client.retrieveIndividualAsync(It.IsAny <FWTObjectID>())) .ReturnsAsync(individualDetails); // Act var result = await _caseService.GetCase("baseCase1"); // Assert Assert.NotNull(result.Customer); }
public async Task GetCase_ShouldCall_Verint_retrieveCaseDetailsAsync() { // Arrange var caseDetails = new retrieveCaseDetailsResponse { FWTCaseFullDetails = CreateBaseCase() }; caseDetails.FWTCaseFullDetails.CoreDetails.AssociatedObject = null; _mockClient .Setup(client => client.retrieveCaseDetailsAsync(It.IsAny <FWTCaseFullDetailsRequest>())) .ReturnsAsync(caseDetails); // Act await _caseService.GetCase("baseCase1"); // Assert _mockClient.Verify(client => client.retrieveCaseDetailsAsync(It.IsAny <FWTCaseFullDetailsRequest>()), Times.Once); }
public async Task GetCase_ShouldReturnMappedOrganisation() { // Arrange var caseDetails = new retrieveCaseDetailsResponse { FWTCaseFullDetails = CreateBaseCase() }; caseDetails.FWTCaseFullDetails.Interactions = new[] { new FWTInteractionDetails { PartyID = new FWTObjectID { ObjectReference = new [] { "test" }, ObjectType = "D1" } } }; _mockClient .Setup(client => client.retrieveCaseDetailsAsync(It.IsAny <FWTCaseFullDetailsRequest>())) .ReturnsAsync(caseDetails); _mockClient .Setup(client => client.retrieveOrganisationAsync(It.IsAny <FWTObjectID>())) .ReturnsAsync(new retrieveOrganisationResponse { FWTOrganisation = new FWTOrganisation() }); // Act var result = await _caseService.GetCase("baseCase1"); // Assert Assert.NotNull(result.Organisation); }