Exemplo n.º 1
0
        public void NumbersSeparatedByCommasInOneStringWorks()
        {
            //Arrange
            StringCalculator testcalc = new StringCalculator();
            //Act
            int result = testcalc.AddString("1,2");

            //Assert
            Assert.AreEqual(result, 3);
        }
Exemplo n.º 2
0
        public void AnyQuantityOfNumbersShouldAdd()
        {
            //Arrange
            StringCalculator testcalc = new StringCalculator();
            //Act
            int result = testcalc.AddString("1", "2", "3", "4", "5");

            //Assert
            Assert.AreEqual(result, 15);
        }
Exemplo n.º 3
0
        public void OneStringShouldEqualItself()
        {
            //Arrange
            StringCalculator testcalc = new StringCalculator();
            //Act
            int result = testcalc.AddString("4");

            //Assert
            Assert.AreEqual(result, 4);
        }
Exemplo n.º 4
0
        public void Strings1and2ShouldEqual3()
        {
            //Arrange
            StringCalculator testcalc = new StringCalculator();
            //Act
            int result = testcalc.AddString("1", "2");

            //Assert
            Assert.AreEqual(result, 3);
        }
Exemplo n.º 5
0
        public void EmptyStringShouldEqual0()
        {
            //Arrange
            StringCalculator testcalc = new StringCalculator();
            //Act
            int result = testcalc.AddString();

            //Assert
            Assert.AreEqual(result, 0);
        }