Beispiel #1
0
        public void CheckNthOcurranceOfChar_inString(char input2, int expectedOutput)
        {
            //arrange
            String input1 = "aabccdafa";
            int    input3 = 2;

            // action
            var actualOutput = CommanOperations.findNthOccurance(input1, input2, input3);

            //Assert
            Assert.AreEqual(actualOutput, expectedOutput);

            //mock progra...// framwork  //testing ..
            // dependency injection...
        }
Beispiel #2
0
 public void CheckstringAfter_Nth_equal()
 {
     Assert.AreEqual(CommanOperations.stringAfter_Nth_equal("abcd;123", 1), ";123");
     Assert.AreEqual(CommanOperations.stringAfter_Nth_equal("abc;xyz;123", 4), "-1");
 }
Beispiel #3
0
 public void CheckstringBefore_Nth_equal()
 {
     Assert.AreEqual(CommanOperations.stringBefore_Nth_equal("abcd=123", 1), "abcd=");
     Assert.AreEqual(CommanOperations.stringBefore_Nth_equal("abc=xyz=123", 4), "-1");
 }