Exemplo n.º 1
0
        public void RequirementSix_AlternativeManyCharacterFormat()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "//;|\n2;5";

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

            /// Assert
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
        public void RequirementOne_AddBlank()
        {
            /// Arrange
            AddEvaluator evaluator = new AddEvaluator();
            var          input     = "";

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

            /// Assert
            Assert.AreEqual(0, total);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
        }