public void ToDomain_WhenCalled_ReturnsCompany() { ICompanyCommand sut = CreateSut(); ICompany result = sut.ToDomain(); Assert.That(result, Is.TypeOf <Company>()); }
public void ToDomain_WhenCommandDoesNotHaveSecondaryPhone_ReturnsContactWithoutSecondaryPhone() { ICompanyCommand sut = CreateSut(hasSecondaryPhone: false); string result = sut.ToDomain().SecondaryPhone; Assert.That(result, Is.Null); }
public void ToDomain_WhenCommandDoesNotHaveHomePage_ReturnsContactWithoutHomePage() { ICompanyCommand sut = CreateSut(hasHomePage: false); string result = sut.ToDomain().HomePage; Assert.That(result, Is.Null); }
public void ToDomain_WhenCommandDoesNotHaveAddressCommand_ReturnsContactWithEmptyAddress() { ICompanyCommand sut = CreateSut(hasAddressCommand: false); IAddress result = sut.ToDomain().Address; Assert.That(result.DisplayAddress, Is.EqualTo(string.Empty)); }
public void ToDomain_WhenCommandHasAddressCommandWhichAreNotEmpty_AssertToDomainWasCalledOnAddressCommand() { Mock <IAddressCommand> addressCommandMock = CreateAddressCommandMock(); ICompanyCommand sut = CreateSut(addressCommand: addressCommandMock.Object); sut.ToDomain(); addressCommandMock.Verify(m => m.ToDomain(), Times.Once()); }
public void ToDomain_WhenCommandDoesNotHaveAddressCommand_AssertToDomainWasNotCalledOnAddressCommand() { Mock <IAddressCommand> addressCommandMock = CreateAddressCommandMock(); ICompanyCommand sut = CreateSut(hasAddressCommand: false, addressCommand: addressCommandMock.Object); sut.ToDomain(); addressCommandMock.Verify(m => m.ToDomain(), Times.Never); }
public void ToDomain_WhenCommandHasCompanyNameCommand_AssertToDomainWasCalledOnCompanyNameCommand() { Mock <ICompanyNameCommand> companyNameCommandMock = CreateCompanyNameCommandMock(); ICompanyCommand sut = CreateSut(companyNameCommandMock.Object); sut.ToDomain(); companyNameCommandMock.Verify(m => m.ToDomain(), Times.Once()); }
public void ToDomain_WhenCommandHasHomePage_ReturnsContactWithHomePageFromCommand() { string homePage = _fixture.Create <string>(); ICompanyCommand sut = CreateSut(homePage: homePage); string result = sut.ToDomain().HomePage; Assert.That(result, Is.EqualTo(homePage)); }
public void ToDomain_WhenCommandHasSecondaryPhone_ReturnsContactWithSecondaryPhoneFromCommand() { string secondaryPhone = _fixture.Create <string>(); ICompanyCommand sut = CreateSut(secondaryPhone: secondaryPhone); string result = sut.ToDomain().SecondaryPhone; Assert.That(result, Is.EqualTo(secondaryPhone)); }
public void ToDomain_WhenCommandHasAddressCommandWhichAreEmpty_ReturnsContactWithEmptyAddress() { IAddressCommand addressCommand = CreateAddressCommandMock(true).Object; ICompanyCommand sut = CreateSut(addressCommand: addressCommand); IAddress result = sut.ToDomain().Address; Assert.That(result.DisplayAddress, Is.EqualTo(string.Empty)); }
public void ToDomain_WhenCommandHasAddressCommandWhichAreNotEmpty_ReturnsContactWithValueFromToDomainOnAddressCommand() { IAddress address = _fixture.BuildAddressMock().Object; IAddressCommand addressCommand = CreateAddressCommandMock(address: address).Object; ICompanyCommand sut = CreateSut(addressCommand: addressCommand); IAddress result = sut.ToDomain().Address; Assert.That(result, Is.EqualTo(address)); }
public void ToDomain_WhenCalled_ReturnsContactWithValueFromToDomainOnNameCommand() { ICompanyName companyName = _fixture.BuildCompanyNameMock().Object; ICompanyNameCommand companyNameCommand = CreateCompanyNameCommandMock(companyName).Object; ICompanyCommand sut = CreateSut(companyNameCommand); IName result = sut.ToDomain().Name; Assert.That(result, Is.EqualTo(companyName)); }