コード例 #1
0
ファイル: SaveTests.cs プロジェクト: mnasif786/Business-Safe
        public void When_update_company_details_Then_calls_bus_to_publish_send_company_details_updated_email_command_with_new_company_details_info()
        {
            //Given
            ICompanyDetailsService target = new CompanyDetailsService(null, _log.Object, _bus.Object);

            //When
            target.Update(_request);

            //Then
            _bus.Verify(x => x.Send(It.Is<SendCompanyDetailsUpdatedEmail>(y =>
                y.NewCompanyDetailsInformation.CompanyName == _request.NewCompanyDetails.CompanyName &&
                y.CAN == _request.CAN &&
                y.NewCompanyDetailsInformation.AddressLine1 == _request.NewCompanyDetails.AddressLine1 &&
                y.NewCompanyDetailsInformation.AddressLine2 == _request.NewCompanyDetails.AddressLine2 &&
                y.NewCompanyDetailsInformation.AddressLine3 == _request.NewCompanyDetails.AddressLine3 &&
                y.NewCompanyDetailsInformation.AddressLine4 == _request.NewCompanyDetails.AddressLine4 &&
                y.NewCompanyDetailsInformation.Postcode == _request.NewCompanyDetails.Postcode &&
                y.NewCompanyDetailsInformation.Telephone == _request.NewCompanyDetails.Telephone &&
                y.NewCompanyDetailsInformation.Website == _request.NewCompanyDetails.Website &&
                y.NewCompanyDetailsInformation.MainContact == _request.NewCompanyDetails.MainContact &&
                y.ActioningUserName == _request.ActioningUserName &&
                y.NewCompanyDetailsInformation.BusinessSafeContactName == _request.NewCompanyDetails.BusinessSafeContactName
            )), Times.Once());
        }
コード例 #2
0
 private static CompanyDetailsService CreateCompanyDetailsService(Mock<IClientService> clientService, Mock<IPeninsulaLog> log)
 {
     var companyDetailsService = new CompanyDetailsService(clientService.Object, log.Object,null);
     return companyDetailsService;
 }