public void ToDomain_WhenMailAddressWasNotGivenInContactAccountDataCommand_ReturnsContactAccountWhereMailAddressIsNull() { IContactAccountDataCommand sut = CreateSut(hasMailAddress: false); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.MailAddress, Is.Null); }
public void ToDomain_WhenCalled_ReturnsContactAccount() { IContactAccountDataCommand sut = CreateSut(); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount, Is.TypeOf <ContactAccount>()); }
public void ToDomain_WhenSecondaryPhoneWasNotGivenInContactAccountDataCommand_ReturnsContactAccountWhereSecondaryPhoneIsNull() { IContactAccountDataCommand sut = CreateSut(hasSecondaryPhone: false); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.SecondaryPhone, Is.Null); }
public void ToDomain_WhenDescriptionWasNotGivenInContactAccountDataCommand_ReturnsContactAccountWhereDescriptionIsNull() { IContactAccountDataCommand sut = CreateSut(hasDescription: false); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.Description, Is.Null); }
public void ToDomain_WhenCalled_ReturnsContactAccountWhereAccountNumberIsEqualToAccountNumberFromContactAccountDataCommand() { string accountNumber = _fixture.Create <string>().ToUpper(); IContactAccountDataCommand sut = CreateSut(accountNumber: accountNumber); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.AccountNumber, Is.EqualTo(accountNumber)); }
public void ToDomain_WhenCalled_ReturnsContactAccountWhereAccountingIsEqualToAccountingFromAccountingRepository() { IAccounting accounting = _fixture.BuildAccountingMock().Object; IContactAccountDataCommand sut = CreateSut(accounting: accounting); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.Accounting, Is.EqualTo(accounting)); }
public void ToDomain_WhenCalled_AssertGetPaymentTermAsyncWasCalledOnAccountingRepository() { int paymentTermNumber = _fixture.Create <int>(); IContactAccountDataCommand sut = CreateSut(paymentTermNumber: paymentTermNumber); sut.ToDomain(_accountingRepositoryMock.Object); _accountingRepositoryMock.Verify(m => m.GetPaymentTermAsync(It.Is <int>(value => value == paymentTermNumber)), Times.Once); }
public void ToDomain_WhenCalled_ReturnsContactAccountWherePaymentTermIsEqualToPaymentTermFromAccountingRepository() { IPaymentTerm paymentTerm = _fixture.BuildPaymentTermMock().Object; IContactAccountDataCommand sut = CreateSut(paymentTerm: paymentTerm); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.PaymentTerm, Is.EqualTo(paymentTerm)); }
public void ToDomain_WhenSecondaryPhoneWasGivenInContactAccountDataCommand_ReturnsContactAccountWhereSecondaryPhoneIsEqualToSecondaryPhoneContactAccountDataCommand() { string secondaryPhone = _fixture.Create <string>(); IContactAccountDataCommand sut = CreateSut(secondaryPhone: secondaryPhone); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.SecondaryPhone, Is.EqualTo(secondaryPhone)); }
public void ToDomain_WhenPrimaryPhoneWasGivenInContactAccountDataCommand_ReturnsContactAccountWherePrimaryPhoneIsEqualToPrimaryPhoneFromContactAccountDataCommand() { string primaryPhone = _fixture.Create <string>(); IContactAccountDataCommand sut = CreateSut(primaryPhone: primaryPhone); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.PrimaryPhone, Is.EqualTo(primaryPhone)); }
public void ToDomain_WhenMailAddressWasGivenInContactAccountDataCommand_ReturnsContactAccountWhereMailAddressIsEqualToMailAddressFromContactAccountDataCommand() { string mailAddress = _fixture.Create <string>(); IContactAccountDataCommand sut = CreateSut(mailAddress: mailAddress); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.MailAddress, Is.EqualTo(mailAddress)); }
public void ToDomain_WhenNoteWasGivenInContactAccountDataCommand_ReturnsContactAccountWhereNoteIsEqualToNoteFromContactAccountDataCommand() { string note = _fixture.Create <string>(); IContactAccountDataCommand sut = CreateSut(note: note); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.Note, Is.EqualTo(note)); }
public void ToDomain_WhenDescriptionWasGivenInContactAccountDataCommand_ReturnsContactAccountWhereDescriptionIsEqualToDescriptionFromContactAccountDataCommand() { string description = _fixture.Create <string>(); IContactAccountDataCommand sut = CreateSut(description: description); IContactAccount contactAccount = sut.ToDomain(_accountingRepositoryMock.Object); Assert.That(contactAccount.Description, Is.EqualTo(description)); }
public void ToDomain_WhenCalled_AssertGetAccountingAsyncWasCalledOnAccountingRepository() { int accountingNumber = _fixture.Create <int>(); IContactAccountDataCommand sut = CreateSut(accountingNumber); sut.ToDomain(_accountingRepositoryMock.Object); _accountingRepositoryMock.Verify(m => m.GetAccountingAsync( It.Is <int>(value => value == accountingNumber), It.Is <DateTime>(value => value == DateTime.Today)), Times.Once); }
public void ToDomain_WhenAccountingRepositoryIsNull_ThrowsArgumentNullException() { IContactAccountDataCommand sut = CreateSut(); ArgumentNullException result = Assert.Throws <ArgumentNullException>(() => sut.ToDomain(null)); Assert.That(result.ParamName, Is.EqualTo("accountingRepository")); }