コード例 #1
0
        public void StringStringCleanUpFuntionality_RemoveEverythingAfter_TEST()
        {
            StringCleanUpFuntionality SCF_TEST = new StringCleanUpFuntionality();
            string testString  = "milk or bacon";
            string RemoveStrat = "or";

            string Expected = "milk ";
            string result   = SCF_TEST.RemoveEverythingAfter(testString, RemoveStrat);

            Assert.AreEqual(Expected, result);
        }
コード例 #2
0
        public void StringStringCleanUpFuntionality_RemoveSubstring_TEST()
        {
            StringCleanUpFuntionality SCF_TEST = new StringCleanUpFuntionality();
            string testString   = "This is not a test";
            string RemoveString = "not";

            string Expected = "This is a test";
            string result   = SCF_TEST.RemoveSubstring(testString, RemoveString);

            Assert.AreEqual(Expected, result);
        }
コード例 #3
0
        public void StringStringCleanUpFuntionality_RemoveIfFirstInString_TEST()
        {
            StringCleanUpFuntionality SCF_TEST = new StringCleanUpFuntionality();
            string testString = "en banana";
            string test       = "en";

            string Expected = "banana";
            string result   = SCF_TEST.RemoveIfFirstInString(testString, test);

            Assert.AreEqual(Expected, result);
        }
コード例 #4
0
        public void StringStringCleanUpFuntionality_RemoveCharFromString_TEST()
        {
            StringCleanUpFuntionality SCF_TEST = new StringCleanUpFuntionality();
            string testString = "banana";
            char   a          = 'a';

            string Expected = "bnn";
            string result   = SCF_TEST.RemoveCharFromString(testString, a);

            Assert.AreEqual(Expected, result);
        }
コード例 #5
0
        public void StringStringCleanUpFuntionality_RemoveInBetween_TEST()
        {
            StringCleanUpFuntionality SCF_TEST = new StringCleanUpFuntionality();
            string testString = "hi this is (not) a test";
            char   a          = '(';
            char   b          = ')';

            string Expected = "hi this is  a test";
            string result   = SCF_TEST.RemoveInBetween(testString, a, b);

            Assert.AreEqual(Expected, result);
        }
コード例 #6
0
        public void StringStringCleanUpFuntionality_RemoveStringOfLentgh_TEST()
        {
            StringCleanUpFuntionality SCF_TEST   = new StringCleanUpFuntionality();
            List <string>             exceptions = new List <string>()
            {
                "Hi"
            };
            string testString = "Hi this is an simple example made to test the method";

            string Expected = "this simple example made test the method";
            string result   = SCF_TEST.removeSubstringOfLentgh(testString, 3, exceptions);

            Assert.AreEqual(Expected, result);
        }