예제 #1
0
        public void NumbersSeparatedByCommasInOneStringWorks()
        {
            //Arrange
            StringCalculator testcalc = new StringCalculator();
            //Act
            int result = testcalc.AddString("1,2");

            //Assert
            Assert.AreEqual(result, 3);
        }
예제 #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);
        }
예제 #3
0
        public void OneStringShouldEqualItself()
        {
            //Arrange
            StringCalculator testcalc = new StringCalculator();
            //Act
            int result = testcalc.AddString("4");

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

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

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