public void GetDuplicateBusinessPartnerIfExists_ReturnsNull_IfMatchNotFound() { //Arrange _mcfClientMock.Setup(mcm => mcm.GetDuplicateBusinessPartnerIfExists(It.IsAny <BpSearchRequest>())) .ReturnsAsync( () => new BpSearchResponse() { BpId = "123456789", BpSearchIdInfoSet = new McfList <IdentifierModel>() { Results = new List <IdentifierModel>() { new IdentifierModel() { IdentifierType = IdentifierType.ZLAST4, IdentifierValue = "1234" } } }, Threshhold = "", Unique = "0 ", Reason = "Because it doesn't match.", ReasonCode = "NO_MATCH" }); var target = new MoveInLogic( _loggerMock.Object, _mcfClientMock.Object, _addressApi.Object, _accountApi.Object, _deviceApiMock.Object, _customerMock.Object, _customerRepositoryMock.Object); //Act var actual = target.GetDuplicateBusinessPartnerIfExists(new BpSearchRequest()); //Assert actual.Result.MatchFound.ShouldBe(false); }
public void GetDuplicateBusinessPartnerIfExists_ReturnsBpSearchModel_GivenExistingBP() { //Arrange _mcfClientMock.Setup(mcm => mcm.GetDuplicateBusinessPartnerIfExists(It.IsAny <BpSearchRequest>())) .ReturnsAsync( () => new BpSearchResponse() { BpId = "123456789", BpSearchIdInfoSet = new McfList <IdentifierModel>() { Results = new List <IdentifierModel>() { new IdentifierModel() { IdentifierType = IdentifierType.ZLAST4, IdentifierValue = "1234" } } }, Threshhold = " x", Unique = "1 ", Reason = "Because it matches.", ReasonCode = "MATCH" }); var target = new MoveInLogic( _loggerMock.Object, _mcfClientMock.Object, _addressApi.Object, _accountApi.Object, _deviceApiMock.Object, _customerMock.Object); //Act var actual = target.GetDuplicateBusinessPartnerIfExists(new BpSearchRequest()); //Assert actual.ShouldNotBeNull(); }