public void test_money_with_same_amount_should_equality() { //given var fiveNT = FakeMoneyBuilder.CreateTWD(5); var fivebucks = FakeMoneyBuilder.CreateUSD(5); //when //then Assert.Equal(fiveNT,FakeMoneyBuilder.CreateTWD(5)); Assert.Equal(fivebucks, FakeMoneyBuilder.CreateUSD(5)); Assert.NotEqual(fivebucks, fiveNT); }
public void test_sum_of_money_gives_full_amount() { //Given var money1 = FakeMoneyBuilder.CreateTWD(5); var money2 = FakeMoneyBuilder.CreateUSD(10); var money3 = FakeMoneyBuilder.CreateTWD(3); //When var sum = exchange.Sum(Currency.Default, money1, money2, money3); var banknote = Money.Create(58, Currency.Default); //Then Assert.Equal(sum, banknote); }