예제 #1
0
        public void BrokerWithCommissionListOfNull_ThrowsException()
        {
            //Arrange
            var broker = new DigiCoinBroker(new List<CommissionEntry> { null, null }, 1);

            //Act
            //Assert
            broker.GetCommission(10);
        }
예제 #2
0
 public void CommissionSetArray1_ReturnsTheCommission()
 {
     //arrange
     const decimal expected = 0.03m;
     var commissionTable = new List<CommissionEntry>
     {
         new CommissionEntry(20, expected),
         new CommissionEntry(60, 1.34m),
         new CommissionEntry(100, 1.35m),
     };
     var broker = new DigiCoinBroker(commissionTable, 1.44m);
     //act
     var result = broker.GetCommission(20);
     //asset
     Assert.AreEqual(expected, result);
 }
예제 #3
0
        public void OrderMoreThen100_ThrowsException()
        {
            //Arrange
            var broker = new DigiCoinBroker(new List<CommissionEntry> { null, null }, 1);

            //Act
            //Assert
            broker.GetCommission(110);
        }
예제 #4
0
        public void OrderNot10Multiplication_ThrowsException()
        {
            //Arrange
            var broker = new DigiCoinBroker(new List<CommissionEntry> { null, null }, 1);

            //Act
            //Assert
            broker.GetCommission(9);
        }
예제 #5
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);
 }