Exemplo n.º 1
0
        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);

            }
        }
Exemplo n.º 2
0
 public void Add_OneValueString(string strValue)
 {
     StringCalc objStringCalc = new StringCalc();
     Assert.AreEqual(2, objStringCalc.Add(strValue));
 }
Exemplo n.º 3
0
        public void Add_GreaterThanSpecifiedValuesString(string strValue)
        {
            StringCalc objStringCalc = new StringCalc();

            Assert.AreEqual(4, objStringCalc.Add(strValue));
        }
Exemplo n.º 4
0
 public void Add_EmptyString(string strValue)
 {
     StringCalc objStringCalc = new StringCalc();
     Assert.AreEqual(0, objStringCalc.Add(strValue));
 }
Exemplo n.º 5
0
 public void Add_ValuesSeparatedWithNewLineAndCommasString(string strValue)
 {
     StringCalc objStringCalc = new StringCalc();
     Assert.AreEqual(19, objStringCalc.Add(strValue));
 }
Exemplo n.º 6
0
 public void Add_ValuesSeparatedWithMultipleDelimitersString(string strValue)
 {
     StringCalc objStringCalc = new StringCalc();
     Assert.AreEqual(3, objStringCalc.Add(strValue));
 }
Exemplo n.º 7
0
 public void Add_ValuesSeparatedWithDelimitersMultipleRepitionAndMultipleTypeString(string strValue)
 {
     StringCalc objStringCalc = new StringCalc();
     Assert.AreEqual(6, objStringCalc.Add(strValue));
 }