public void Add_NegativeValuesString(string strValue) { // string message = "Negative not allowed:"; try { StringCalc objStringCalc = new StringCalc(); int i = objStringCalc.Add(strValue); if (objStringCalc.NegativeCollection.Count <= 0) { throw new Exception("Method expecting negative as argument!"); } } catch (ArgumentException ex) { Debug.WriteLine(ex.Message); Assert.Pass(ex.Message); } catch (Exception ex) { Debug.WriteLine(ex.Message); Assert.Fail(ex.Message); } }
public void Add_OneValueString(string strValue) { StringCalc objStringCalc = new StringCalc(); Assert.AreEqual(2, objStringCalc.Add(strValue)); }
public void Add_GreaterThanSpecifiedValuesString(string strValue) { StringCalc objStringCalc = new StringCalc(); Assert.AreEqual(4, objStringCalc.Add(strValue)); }
public void Add_EmptyString(string strValue) { StringCalc objStringCalc = new StringCalc(); Assert.AreEqual(0, objStringCalc.Add(strValue)); }
public void Add_ValuesSeparatedWithNewLineAndCommasString(string strValue) { StringCalc objStringCalc = new StringCalc(); Assert.AreEqual(19, objStringCalc.Add(strValue)); }
public void Add_ValuesSeparatedWithMultipleDelimitersString(string strValue) { StringCalc objStringCalc = new StringCalc(); Assert.AreEqual(3, objStringCalc.Add(strValue)); }
public void Add_ValuesSeparatedWithDelimitersMultipleRepitionAndMultipleTypeString(string strValue) { StringCalc objStringCalc = new StringCalc(); Assert.AreEqual(6, objStringCalc.Add(strValue)); }