Ejemplo n.º 1
0
        public void all_remainder_of_coins()
        {
            int[] array    = new int[] { 0, 1, 0 };
            var   exchange = CoinsExchange.Calculation(5, 2, 10);

            Assert.AreEqual(exchange.Remainder, array);
        }
Ejemplo n.º 2
0
        public void number_of_coins_A_for_Strategy_1()
        {
            var           exchange = CoinsExchange.Calculation(4, 3, 8);
            OptimalResult optimal  = exchange.Optimal(50, exchange);

            Assert.AreEqual(optimal.number_of_coins_A, 2);
        }
Ejemplo n.º 3
0
        public void no_coin_inversion()
        {
            var exchange = CoinsExchange.Calculation(8, 3, 10);

            Assert.AreEqual(exchange.a, 8);
            Assert.AreEqual(exchange.b, 3);
        }
Ejemplo n.º 4
0
        public void coin_inversion()
        {
            var exchange = CoinsExchange.Calculation(2, 6, 10);

            Assert.AreEqual(exchange.a, 6);
            Assert.AreEqual(exchange.b, 2);
        }
Ejemplo n.º 5
0
        public void calculation_of_зуксуте_for_optimal_combination_for_Strategy_2()
        {
            var           exchange = CoinsExchange.Calculation(6, 3, 10);
            OptimalResult optimal  = exchange.Optimal(50, exchange);

            Assert.AreEqual(optimal.percent_An, 50);
        }
Ejemplo n.º 6
0
        public void number_of_coins_B_for_Strategy_2()
        {
            var           exchange = CoinsExchange.Calculation(6, 3, 10);
            OptimalResult optimal  = exchange.Optimal(50, exchange);

            Assert.AreEqual(optimal.number_of_coins_B, 1);
        }
Ejemplo n.º 7
0
        public void all_combinations_of_coins()
        {
            int[,] array = new int[, ] {
                { 2, 2, 2, 2, 2 }, { 2, 2, 5, 0, 0 }, { 5, 5, 0, 0, 0 }
            };
            var exchange = CoinsExchange.Calculation(5, 2, 10);

            Assert.AreEqual(exchange.Ways, array);
        }
Ejemplo n.º 8
0
 // END CUT HERE
 // BEGIN CUT HERE
 public static void Main()
 {
     try {
     CoinsExchange ___test = new CoinsExchange();
     ___test.run_test(-1);
     } catch(Exception e) {
     //Console.WriteLine(e.StackTrace);
     Console.WriteLine(e.ToString());
     }
 }
Ejemplo n.º 9
0
// END CUT HERE
// BEGIN CUT HERE
    public static void Main()
    {
        try {
            CoinsExchange ___test = new CoinsExchange();
            ___test.run_test(-1);
        } catch (Exception e) {
//Console.WriteLine(e.StackTrace);
            Console.WriteLine(e.ToString());
        }
    }
Ejemplo n.º 10
0
        public void choice_of_strategy_2()
        {
            var exchange = CoinsExchange.Calculation(6, 3, 10);

            Assert.That(exchange.strategy, Is.TypeOf(typeof(StrategyWithRemainder)));
        }
Ejemplo n.º 11
0
        public void count_number_of_zero_remainder()
        {
            var exchange = CoinsExchange.Calculation(5, 2, 10);

            Assert.AreEqual(exchange.count_zero_R, 2);
        }
Ejemplo n.º 12
0
        public void count_max_number_of_coins()
        {
            var exchange = CoinsExchange.Calculation(5, 2, 10);

            Assert.AreEqual(exchange.MaxCountMoney, 5);
        }