Ejemplo n.º 1
0
 public void ThrowsNegativeNotAllowedExceptionWhenOneNewlineMinusTwoIsPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("1\n-2");
     Assert.AreEqual(0, result);
 }
Ejemplo n.º 2
0
 public void ThrowForMatExceptionWhenSlashSlashDelimiterNewLine()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("//;\n");
    // Assert.AreEqual(0, result);
 }
Ejemplo n.º 3
0
 public void ThrowFormatExceptionWhenSlashSlashDelimiterNewLineADelimiterBIsPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("//;\na;b");
      Assert.AreEqual(0, result);
 }
Ejemplo n.º 4
0
 public void ReturnThreeWhenSlashSlashDelimiterNewLineNullOneDelimiterTwoISPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("//\n\n1\n2");
     Assert.AreEqual(3, result);
 }
Ejemplo n.º 5
0
 public void ExceptionOccuredwhenSlashSlashCommaIsPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("//,");
     Assert.AreEqual(3, result);
 }
Ejemplo n.º 6
0
 public void ReturnThreeWhenOneCommaTwoISPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("1,2");
     Assert.AreEqual(3, result);
 }
Ejemplo n.º 7
0
  public void ReturnSixWhenOneNewlineTwoCommaThreeISPassed()
  {
      AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
      int result = ob.Add("1\n2,3");
      Assert.AreEqual(6, result);
 } 
Ejemplo n.º 8
0
 public void ReturnTwoWhenTwoISPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("2");
     Assert.AreEqual(2, result);
 }
Ejemplo n.º 9
0
 public void ReturnOneWhenOneISPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("1");
     Assert.AreEqual(1, result);
 }
Ejemplo n.º 10
0
 public void ThrowArguementExceptionWhenSlashSlashABCIsPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("//abc");
     Assert.AreEqual(0, result);
 }
Ejemplo n.º 11
0
 public void ThrowsNegativeNotAllowedExceptionWhenSlashSlashDelimiterNewlineMinusOneNewlineTwoIsPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("//\n\n-1\n2");
     Assert.AreEqual(0, result);
 }
Ejemplo n.º 12
0
 public void ReturnZeroWhenNullStringISPassed()
 {
     AirthmeticStringCalculator ob = new AirthmeticStringCalculator();
     int result = ob.Add("");
     Assert.AreEqual(0, result);
 }