Exemplo n.º 1
0
        public void Monies_WhenNotEqual_HashCodesNotEqual()
        {
            // Arrange
            var m1 = new FakeMoney(100m, Currencies.UnitedStatesDollar);
            var m2 = new FakeMoney(101m, Currencies.UnitedStatesDollar);

            // Act
            var hashCodesEqual = m1.GetHashCode() == m2.GetHashCode();

            // Assert
            hashCodesEqual.Should().BeFalse();
        }
Exemplo n.º 2
0
        public void Monies_AreNotEqual()
        {
            // Arrange
            var m1 = new FakeMoney(100m, Currencies.UnitedStatesDollar);
            var m2 = new FakeMoney(101m, Currencies.UnitedStatesDollar);

            // Act
            var areEqual = m1 == m2;

            // Assert
            areEqual.Should().BeFalse();
        }
Exemplo n.º 3
0
        public void GetTheAmount()
        {
            // Arrange
            var expectedAmount = 100.50m;
            var currency       = Currencies.UnitedStatesDollar;
            var money          = new FakeMoney(expectedAmount, currency);

            // Act
            var actualAmount = money.Amount;

            // Assert
            actualAmount.Should().Be(expectedAmount);
        }
Exemplo n.º 4
0
        public void GetTheCurrency()
        {
            // Arrange
            var amount           = 100.50m;
            var expectedCurrency = Currencies.UnitedStatesDollar;
            var money            = new FakeMoney(amount, expectedCurrency);

            // Act
            var actualCurrency = money.Currency;

            // Assert
            actualCurrency.Should().Be(Currencies.UnitedStatesDollar);
        }