예제 #1
0
        public void YearDifferenceGivesBigFine()
        {
            string[] input =
            {
                "12 9 2016",
                "9 1 2015"
            };

            int result = new LibraryFine(MoqUtil.SetupRandMock(input)).SolveIt();

            Assert.AreEqual(10000, result);
        }
예제 #2
0
        public void FailingTest1()
        {
            string[] input =
            {
                "5 5 2014",
                "23 2 2014"
            };

            int result = new LibraryFine(MoqUtil.SetupRandMock(input)).SolveIt();

            Assert.AreEqual(1500, result);
        }
예제 #3
0
        public void EightMonthsDifferenceGives4000Fine()
        {
            string[] input =
            {
                "12 9 2015",
                "9 1 2015"
            };

            int result = new LibraryFine(MoqUtil.SetupRandMock(input)).SolveIt();

            Assert.AreEqual(4000, result);
        }
예제 #4
0
        public void TwoMonthsDifferenceGives1000Fine()
        {
            string[] input =
            {
                "9 6 2015",
                "9 4 2015"
            };

            int result = new LibraryFine(MoqUtil.SetupRandMock(input)).SolveIt();

            Assert.AreEqual(1000, result);
        }
예제 #5
0
        public void ThreeDaysDifferenceGives45Fine()
        {
            string[] input =
            {
                "9 6 2015",
                "6 6 2015"
            };

            int result = new LibraryFine(MoqUtil.SetupRandMock(input)).SolveIt();

            Assert.AreEqual(45, result);
        }
예제 #6
0
        public void ActualLessThanExpectedGivesZeroFine()
        {
            string[] input =
            {
                "5 6 2015",
                "9 6 2015"
            };

            int result = new LibraryFine(MoqUtil.SetupRandMock(input)).SolveIt();

            Assert.AreEqual(0, result);
        }
예제 #7
0
        public void MatchingDatesGiveZeroFine()
        {
            string[] input =
            {
                "9 6 2015",
                "9 6 2015"
            };

            int result = new LibraryFine(MoqUtil.SetupRandMock(input)).SolveIt();

            Assert.AreEqual(0, result);
        }
        public void LibraryFineTests()
        {
            /*
             *  6 6 2015
             *  9 6 2016
             *  0
             */
            /*
             *
             * 31 8 2004
             * 20 1 2004
             * 3500
             */

            //returned, expected
            Assert.AreEqual(0, LibraryFine.Fine("6", "6", "2015", "2016", "6", "9"));
            Assert.AreEqual(3500, LibraryFine.Fine("31", "8", "2004", "2004", "1", "20"));
            Assert.AreEqual(0, LibraryFine.Fine("7", "2", "1014", "1015", "1", "1"));
        }