Example #1
0
        public void MoneysAreSymmetric()
        {
            Money moneyA = new MoneyBuilder().Build();
            Money moneyB = new MoneyBuilder().Build();

            moneyA.Should().Be(moneyB);
            moneyB.Should().Be(moneyA);
        }
Example #2
0
        public void SubtractGstReturnsOriginalMoneyIncreasedByGSTAmount()
        {
            Money money    = new MoneyBuilder().WithPrice(1900.5m).Build();
            Gst   gst      = new Gst(12.5m);
            Money expected = money.Multiply(gst.GstFraction / gst.Multiplier);

            Money actual = money.GstPaid(gst);

            actual.Should().Be(expected);
        }
Example #3
0
        public void MoneysAreTransitive()
        {
            Money moneyA = new MoneyBuilder().Build();
            Money moneyB = new MoneyBuilder().Build();
            Money moneyC = new MoneyBuilder().Build();

            moneyA.Should().Be(moneyB);
            moneyB.Should().Be(moneyC);
            moneyA.Should().Be(moneyC);
        }
Example #4
0
        public void MoneyIsNotEqualToNull()
        {
            Money money = new MoneyBuilder().Build();

            money.Should().NotBeNull();
        }
Example #5
0
        public void MoneysAreReflexive()
        {
            Money money = new MoneyBuilder().Build();

            money.Should().Be(money);
        }
Example #6
0
        public void SubtractGstReturnsOriginalMoneyIncreasedByGSTAmount()
        {
            Money money = new MoneyBuilder().WithPrice(1900.5m).Build();
            Gst gst = new Gst(12.5m);
            Money expected = money.Multiply(gst.GstFraction / gst.Multiplier);

            Money actual = money.GstPaid(gst);

            actual.Should().Be(expected);
        }
Example #7
0
        public void MoneysAreTransitive()
        {
            Money moneyA = new MoneyBuilder().Build();
            Money moneyB = new MoneyBuilder().Build();
            Money moneyC = new MoneyBuilder().Build();

            moneyA.Should().Be(moneyB);
            moneyB.Should().Be(moneyC);
            moneyA.Should().Be(moneyC);
        }
Example #8
0
        public void MoneysAreSymmetric()
        {
            Money moneyA = new MoneyBuilder().Build();
            Money moneyB = new MoneyBuilder().Build();

            moneyA.Should().Be(moneyB);
            moneyB.Should().Be(moneyA);
        }
Example #9
0
 public void MoneysAreReflexive()
 {
     Money money = new MoneyBuilder().Build();
     money.Should().Be(money);
 }
Example #10
0
 public void MoneyIsNotEqualToNull()
 {
     Money money = new MoneyBuilder().Build();
     money.Should().NotBeNull();
 }