Ejemplo n.º 1
0
        public void CommissionSetToSomeNumber_ReturnsTheCommission()
        {
            //arrange
            const decimal expected = 0.03m;
            var           broker   = new DigiCoinBroker(expected, 1.44m);
            //act
            var result = broker.GetCommission(20);

            //asset
            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 2
0
        public void OrderNot10Multiplication_ThrowsException()
        {
            //Arrange
            var broker = new DigiCoinBroker(new List <CommissionEntry> {
                null, null
            }, 1);

            //Act
            //Assert
            broker.GetCommission(9);
        }
Ejemplo n.º 3
0
        public void BrokerWithCommissionListOfNull_ThrowsException()
        {
            //Arrange
            var broker = new DigiCoinBroker(new List <CommissionEntry> {
                null, null
            }, 1);

            //Act
            //Assert
            broker.GetCommission(10);
        }
Ejemplo n.º 4
0
        public void OrderMoreThen100_ThrowsException()
        {
            //Arrange
            var broker = new DigiCoinBroker(new List <CommissionEntry> {
                null, null
            }, 1);

            //Act
            //Assert
            broker.GetCommission(110);
        }
Ejemplo n.º 5
0
        public void CommissionSetArray1_ReturnsTheCommission3()
        {
            //arrange
            const decimal expected        = 0.03m;
            var           commissionTable = new List <CommissionEntry>
            {
                new CommissionEntry(20, 1.3m),
                new CommissionEntry(100, 1.35m),
                new CommissionEntry(60, expected),
            };
            var broker = new DigiCoinBroker(commissionTable, 1.44m);
            //act
            var result = broker.GetCommission(50);

            //asset
            Assert.AreEqual(expected, result);
        }