Example #1
0
        public void TestAdd()                             // publiczna klasa dodawania
        {
            MathsComponent obj    = new MathsComponent(); // tworznie nowego obiektu
            int            result = obj.Add(2, 2);        //inicjowanie dwóch zmiennych liczbowych

            Assert.AreEqual(4, result);                   // wynik który ma wyjsc z testu
        }
Example #2
0
        public void TestSubtract2()
        {
            MathsComponent obj    = new MathsComponent();
            int            result = obj.Subtract(10, 5);

            Assert.AreEqual(5, result);
        }
        public void TestCheckGreater()
        {
            MathsComponent great = new MathsComponent();
            int            final = great.CheckGreater(-5, 10);

            Assert.AreEqual(10, final);
        }
        public void TestCheckPasswdLength()
        {
            MathsComponent obj    = new MathsComponent();
            bool           result = obj.CheckPasswdLen("Steakhouse");

            Assert.AreEqual(true, result);
        }
        public void TestSubtract()
        {
            MathsComponent obj     = new MathsComponent();
            int            result2 = obj.Subtract(100, 90);

            Assert.AreEqual(10, result2);
        }
Example #6
0
        public void TestProduction()
        {
            MathsComponent obj    = new MathsComponent();
            int            result = obj.Product(10, 10);

            Assert.AreEqual(100, result);
        }
Example #7
0
        public void TestSubstract()
        {
            MathsComponent obj    = new MathsComponent();
            int            result = obj.Sub(20, 10);

            Assert.AreEqual(10, result);
        }
Example #8
0
        public void TestMultiple()
        {
            MathsComponent obj    = new MathsComponent();
            int            result = obj.Multiple(10, 10);

            Assert.AreEqual(100, result);
        }
        public void TestMethod1()
        {
            MathsComponent obj    = new MathsComponent();
            int            result = obj.Add(10, 10);

            Assert.AreEqual(20, result);
        }
Example #10
0
        public void TestDivide()
        {
            MathsComponent obj    = new MathsComponent();
            int            result = obj.Divide(10, 10);

            Assert.AreEqual(1, result);
        }
Example #11
0
        public void TestAdd()
        {
            // TODO: Add text logic here
            MathsComponent obj    = new MathsComponent();
            int            result = obj.Add(10, 10);

            Assert.AreEqual(20, result);
        }
Example #12
0
        public void WhenNumbersSeparatedWithEitherNewLineANdCommaReturnSum()
        {
            string input = "3\n4,-2";
            int expected = 5;

            var obj = new MathsComponent();
            int result = obj.StringCalculator(input);
            Assert.AreEqual(result, expected);


        }
Example #13
0
 public void WhenGreatherThan100ReturnException()
 {
     var obj = new MathsComponent();
     try
     {
         string result = obj.FizzBuz(1000);
         Assert.Fail("no exception thrown");
     }
     catch (Exception ex)
     {
         Assert.IsTrue(ex.Message == "Not Allowed beacause it is Greather Than 100");
     }
 }
Example #14
0
 public void IspalindromTest2()
 {
     var obj = new MathsComponent();
     bool result = obj.IsPalindrom2("civic");
     Assert.IsTrue(result);
 }
Example #15
0
 public void WHenMultipleFiveAndMultipleThreeThanReturnFizzBuzz()
 {
     var obj = new MathsComponent();
     string result = obj.FizzBuz(15);
     Assert.AreEqual(result, "FizBuzz");
 }
Example #16
0
 public void WhenMultipleThreeReturnFizz()
 {
     var obj = new MathsComponent();
     string result = obj.FizzBuz(3);
     Assert.AreEqual(result, "Fizz");
 }
Example #17
0
 public void WHenMultipleFiveReturnBuzz()
 {
     var obj = new MathsComponent();
     string result = obj.FizzBuz(5);
     Assert.AreEqual(result, "Buzz");
 }
Example #18
0
 public void TestSubstruct()
 {
     var obj = new MathsComponent();
     int result = obj.Substruct(10, 10);
     Assert.AreEqual(0, result);
 }
Example #19
0
 public void TestAdd()
 {
     var obj = new MathsComponent();
     int result = obj.Add(10, 10);
     Assert.AreEqual(20, result);
 }