Exemple #1
0
 public void Test1()
 {
     Assert.Equal(0, CarMileage.IsInteresting(3, new List <int>()
     {
         1337, 256
     }));
     Assert.Equal(1, CarMileage.IsInteresting(1336, new List <int>()
     {
         1337, 256
     }));
     Assert.Equal(2, CarMileage.IsInteresting(1337, new List <int>()
     {
         1337, 256
     }));
     Assert.Equal(0, CarMileage.IsInteresting(11208, new List <int>()
     {
         1337, 256
     }));
     Assert.Equal(1, CarMileage.IsInteresting(11209, new List <int>()
     {
         1337, 256
     }));
     Assert.Equal(2, CarMileage.IsInteresting(11211, new List <int>()
     {
         1337, 256
     }));
 }
Exemple #2
0
        public void IsInteresting_OnInterestingReturns2(int num)
        {
            var expected = 2;
            var actual   = CarMileage.IsInteresting(num, new List <int>());

            Assert.AreEqual(expected, actual, $"{num}");
        }
Exemple #3
0
        public void IsInteresting_OnListMatchReturns2(int dec, int expected)
        {
            var num  = 23409 - dec;
            var list = new List <int> {
                2344, 234243, 13123, 23409, 292929, 098098
            };
            var actual = CarMileage.IsInteresting(num, list);

            Assert.AreEqual(expected, actual, $"{num}");
        }