public void ShouldReturnNullIfNicknameIsNull() { var bank = new Bank(new EmptyNicknameValidator(), new DuplicatedNicknameValidator()); var customer = bank.AddCustomer(null, new DateTime(1971, 1, 1)); Assert.That(customer, Is.Null); }
public void ShouldAddCustomerNickname() { var bank = new Bank(new EmptyNicknameValidator(), new DuplicatedNicknameValidator()); var customer = bank.AddCustomer("andy", new DateTime(1971, 1, 1)); Assert.That(customer, Is.Not.Null); }
public void AMessageIsSentToTheCustomerWhoWasAddedToTheBankImplementeWithMock() { string expectedRecipient = "*****@*****.**"; string expectedContent = "Dear Andy, welcome to the bank."; var mockGateway = new Mock<MessageGateway>(); mockGateway.Setup(x => x.Send(expectedRecipient, expectedContent)); var bank = new Bank(new EmptyNicknameValidator(), new DuplicatedNicknameValidator(), mockGateway.Object); var customer = bank.AddCustomer("Andy", new DateTime(1981, 1, 1), "*****@*****.**"); mockGateway.VerifyAll(); }
public void TheBonusIsAddedAfterTheTwoYearPeriodPasswedAndWhenCustomersMakeADeposit() { var bank = new Bank(new EmptyNicknameValidator(), new DuplicatedNicknameValidator(), new MessageGatewayStub()); var customer = bank.AddCustomer("Hannah", new DateTime(1981, 1, 1), "*****@*****.**"); customer.Deposit(100); SystemTime.Today = () => new DateTime(2020, 1, 1); customer.Deposit(100); Assert.That(customer.GetBanalce(), Is.EqualTo(200 + 50)); }
public void SetUp() { _messageGatewayStub = new MessageGatewayStub(); var bank = new Bank(new EmptyNicknameValidator(), new DuplicatedNicknameValidator(), _messageGatewayStub); _customer = bank.AddCustomer("Andy", new DateTime(1981, 01, 01), "*****@*****.**"); }