Esempio n. 1
0
 public void TestMinComputeLessThanZero()
 {
     var       service = new ChangeGenerator();
     Exception ex      = Assert.Throws <ArgumentOutOfRangeException>(() => service.ComputeChange(-1, (list) =>
     {
         var reducer = new MinReducer();
         return(reducer.Reduce(list));
     }));
 }
Esempio n. 2
0
        public void TestMinComputePassOne()
        {
            var service = new ChangeGenerator();
            var result  = service.ComputeChange(103, (list) =>
            {
                var reducer = new MinReducer();
                return(reducer.Reduce(list));
            });

            Assert.Equal(result.TotalCoins, 4);
        }