Exemplo n.º 1
0
        public void FiveDollars_FiveDollars_AreEqual()
        {
            var fiveDollars1 = MoneyProvider.Dollar(5);
            var fiveDollars2 = MoneyProvider.Dollar(5);

            Assert.AreEqual(fiveDollars1, fiveDollars2);
        }
Exemplo n.º 2
0
        public void FiveDollars_FiveFrancs_AreNotEqual()
        {
            var fiveDollars = MoneyProvider.Dollar(5);
            var fiveFrancs  = MoneyProvider.Franc(5);

            Assert.AreNotEqual(fiveDollars, fiveFrancs);
        }
Exemplo n.º 3
0
        public void FiveDollars_SixDollars_AreNotEqual()
        {
            var fiveDollars = MoneyProvider.Dollar(5);
            var sixDollars  = MoneyProvider.Dollar(6);

            Assert.AreNotEqual(fiveDollars, sixDollars);
        }
Exemplo n.º 4
0
        public void Exchange_FiveDollars_To_Dollars_Result_FiveDollars()
        {
            // Arrange
            var fiveDollars = MoneyProvider.Dollar(5);

            // Act
            var result = _exchanger.Exchange(fiveDollars, Currency.USD);

            // Assert
            Assert.AreEqual(fiveDollars, result);
        }
Exemplo n.º 5
0
        public void ThreeFrancs_Times_Four_Equals_SixDollars()
        {
            // Arrange
            var threeFrancs = MoneyProvider.Franc(3);
            var sixDollars  = MoneyProvider.Dollar(6);

            // Act
            var product = _calculation.Product(threeFrancs, 4, Currency.USD);

            // Assert
            Assert.AreEqual(sixDollars, product);
        }
Exemplo n.º 6
0
        public void TwoDollars_Times_Three_Equals_TwelveFrancs()
        {
            // Arrange
            var twoDollars   = MoneyProvider.Dollar(2);
            var twelveFrancs = MoneyProvider.Franc(12);

            // Act
            var product = _calculation.Product(twoDollars, 3, Currency.CHF);

            // Assert
            Assert.AreEqual(twelveFrancs, product);
        }
Exemplo n.º 7
0
        public void TwoDollars_Times_Three_Equals_SixDollars()
        {
            // Arrange
            var twoDollars = MoneyProvider.Dollar(2);
            var sixDollars = MoneyProvider.Dollar(6);

            // Act
            var product = _calculation.Product(twoDollars, 3, Currency.USD);

            // Assert
            Assert.AreEqual(sixDollars, product);
        }
Exemplo n.º 8
0
        public void Exchange_ThreeDollars_To_Francs_Result_SixFrancs()
        {
            // Arrange
            var dollars = MoneyProvider.Dollar(3);
            var franc   = MoneyProvider.Franc(6);

            // Act
            var result = _exchanger.Exchange(dollars, Currency.CHF);

            // Assert
            Assert.AreEqual(franc, result);
        }
Exemplo n.º 9
0
        public void Exchange_TwoFrancs_To_Dollars_Result_OneDollar()
        {
            // Arrange
            var twoFrancs = MoneyProvider.Franc(2);
            var oneDollar = MoneyProvider.Dollar(1);

            // Act
            var result = _exchanger.Exchange(twoFrancs, Currency.USD);

            // Assert
            Assert.AreEqual(oneDollar, result);
        }
Exemplo n.º 10
0
        public void SixFrancs_Plus_TwoDollars_Equals_TenFrancs()
        {
            // Arrange
            var sixFrancs  = MoneyProvider.Franc(6);
            var twoDollars = MoneyProvider.Dollar(2);

            var tenFrancs = MoneyProvider.Franc(10);

            // Act
            var sum = _calculation.Sum(sixFrancs, twoDollars, Currency.CHF);

            // Assert
            Assert.AreEqual(tenFrancs, sum);
        }
Exemplo n.º 11
0
        public void FiveDollars_Plus_TenFrancs_Equals_TwentyFrancs()
        {
            // Arrange
            var fiveDollars = MoneyProvider.Dollar(5);
            var tenFrancs   = MoneyProvider.Franc(10);

            var twentyFrancs = MoneyProvider.Franc(20);

            // Act
            var sum = _calculation.Sum(fiveDollars, tenFrancs, Currency.CHF);

            // Assert
            Assert.AreEqual(twentyFrancs, sum);
        }
Exemplo n.º 12
0
        public void ThreeDollars_Plus_FourDollars_Equals_SevenDollars()
        {
            // Arrange
            var threeDollars = MoneyProvider.Dollar(3);
            var fourDollars  = MoneyProvider.Dollar(4);

            var sevenDollars = MoneyProvider.Dollar(7);

            // Act
            var sum = _calculation.Sum(threeDollars, fourDollars, Currency.USD);

            // Assert
            Assert.AreEqual(sevenDollars, sum);
        }
Exemplo n.º 13
0
        public void SixFrancs_Plus_TwoDollars_Equals_FiveDollars()
        {
            // Arrange
            var sixFrancs  = MoneyProvider.Franc(6);
            var twoDollars = MoneyProvider.Dollar(2);

            var fiveDollars = MoneyProvider.Dollar(5);

            // Act
            var sum = _calculation.Sum(sixFrancs, twoDollars, Currency.USD);

            // Assert
            Assert.AreEqual(fiveDollars, sum);
        }
Exemplo n.º 14
0
        public void CreateFiveDollars_CheckAmount()
        {
            var fiveDollars = MoneyProvider.Dollar(5);

            Assert.AreEqual(5, fiveDollars.Amount);
        }
Exemplo n.º 15
0
        public void CreateFiveDollars_CheckCurrency()
        {
            var fiveDollars = MoneyProvider.Dollar(5);

            Assert.AreEqual(Currency.USD, fiveDollars.Currency);
        }