示例#1
0
        public void RequirementSix_AlternativeManyCharacterFormat()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "//;|\n2;5";

            /// Act
            var total = evaluator.RequirementSix(input);

            /// Assert
        }
示例#2
0
        public void RequirementThree_AddNumbersWithSecondDeliminatorNewLine()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "1\n2,3";

            /// Act
            var total = evaluator.RequirementThree(input);

            /// Assert
            Assert.AreEqual(6, total);
        }
示例#3
0
        public void RequirementTwo_AddManyNumbers()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5";

            /// Act
            var total = evaluator.RequirementTwo(input);

            /// Assert
            Assert.AreEqual(200, total);
        }
示例#4
0
        public void RequirementOne_AddNumbersMixedWithText()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "5,tytyt";

            /// Act
            var total = evaluator.RequirementOne(input);

            /// Assert
            Assert.AreEqual(5, total);
        }
示例#5
0
        public void RequirementOne_AddMoreThanTwoValues()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "5,5,5,5";

            /// Act
            var total = evaluator.RequirementOne(input);

            /// Assert
            Assert.AreEqual(10, total);
        }
示例#6
0
        public void RequirementOne_AddBlank()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "";

            /// Act
            var total = evaluator.RequirementOne(input);

            /// Assert
            Assert.AreEqual(0, total);
        }
示例#7
0
        public void RequirementEight_PreviousFormat()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "2,5,3";

            /// Act
            var total = evaluator.RequirementEight(input);

            /// Assert
            Assert.AreEqual(10, total);
        }
示例#8
0
        public void RequirementEight_ManyAlternativeManyCharacterFormats()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "//[*][!!][r9r]\n11r9r22*33!!44";

            /// Act
            var total = evaluator.RequirementEight(input);

            /// Assert
            Assert.AreEqual(110, total);
        }
示例#9
0
        public void RequirementOne_AddTwoNumbers()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "1,5000";

            /// Act
            var total = evaluator.RequirementOne(input);

            /// Assert
            Assert.AreEqual(5001, total);
        }
示例#10
0
        public void RequirementSeven_AlternativeManyCharacterFormat()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "//[***]\n11***22***33";

            /// Act
            var total = evaluator.RequirementSeven(input);

            /// Assert
            Assert.AreEqual(66, total);
        }
示例#11
0
        public void RequirementSix_AlternativeSingleCharacterFormat()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "//;\n2;5";

            /// Act
            var total = evaluator.RequirementSix(input);

            /// Assert
            Assert.AreEqual(7, total);
        }
示例#12
0
        public void RequirementFive_AcceptLE1000()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "2,1000,6";

            /// Act
            var total = evaluator.RequirementFive(input);

            /// Assert
            Assert.AreEqual(1008, total);
        }
示例#13
0
        public void RequirementFour_NegativeValuesNOTIncluded()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "1,3,4";

            /// Act
            var total = evaluator.RequirementFour(input);

            /// Assert
            Assert.AreEqual(8, total);
        }
示例#14
0
        public void RequirementFour_NegativeValuesIncluded()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "-1,3,-4";

            /// Act
            var total = evaluator.RequirementFour(input);

            /// Assert
            Assert.Fail();
        }