Example #1
0
        public void ThrowFormatExceptionWhenSlashSlashDelimiterNewLineADelimiterBIsPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("//;\na;b");

            Assert.AreEqual(0, result);
        }
Example #2
0
        public void ThrowsNegativeNotAllowedExceptionWhenMinusOneNewlineTwoIsPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("-1\n2");

            Assert.AreEqual(0, result);
        }
Example #3
0
        public void ExceptionOccuredwhenSlashSlashCommaIsPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("//,");

            Assert.AreEqual(3, result);
        }
Example #4
0
        public void ReturnSixWhenOneNewlineTwoCommaThreeISPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("1\n2,3");

            Assert.AreEqual(6, result);
        }
Example #5
0
        public void ReturnThreeWhenSlashSlashDelimiterNewLineNullOneDelimiterTwoISPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("//\n\n1\n2");

            Assert.AreEqual(3, result);
        }
Example #6
0
        public void ReturnThreeWhenOneCommaTwoISPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("1,2");

            Assert.AreEqual(3, result);
        }
Example #7
0
        public void ReturnTwoWhenTwoISPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("2");

            Assert.AreEqual(2, result);
        }
Example #8
0
        public void ReturnOneWhenOneISPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("1");

            Assert.AreEqual(1, result);
        }
Example #9
0
        public void ThrowArguementExceptionWhenSlashSlashABCIsPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("//abc");

            Assert.AreEqual(0, result);
        }
Example #10
0
        public void ReturnZeroWhenNullStringISPassed()
        {
            AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
            int result = ob.Add("");

            Assert.AreEqual(0, result);
        }
Example #11
0
 public void ThrowForMatExceptionWhenSlashSlashDelimiterNewLine()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("//;\n");
     // Assert.AreEqual(0, result);
 }