示例#1
0
            public void Finds1_Params()
            {
                string source = "hello world";
                bool   result = SrkStringExtensions.ContainsAny(source, StringComparison.InvariantCulture, 'h', 'x');

                Assert.IsTrue(result);
            }
示例#2
0
            public void FalseIsSourceIsEmpty()
            {
                string source = string.Empty;
                bool   result = SrkStringExtensions.ContainsAny(source, StringComparison.CurrentCulture, new string[] { string.Empty, });

                Assert.IsFalse(result);
            }
示例#3
0
            public void Finds1CaseIgnore()
            {
                string source = "Hello World";
                var    values = new char[] { 'h', 'x', };
                bool   result = SrkStringExtensions.ContainsAny(source, StringComparison.InvariantCultureIgnoreCase, values);

                Assert.IsTrue(result);
            }
示例#4
0
            public void Finds2()
            {
                string source = "hello world";
                var    values = new char[] { 'x', 'w', };
                bool   result = SrkStringExtensions.ContainsAny(source, StringComparison.InvariantCulture, values);

                Assert.IsTrue(result);
            }
示例#5
0
            public void Finds1CaseMatch()
            {
                string source = "Hello World";
                var    values = new string[] { "hello", "guys", };
                bool   result = SrkStringExtensions.ContainsAny(source, StringComparison.InvariantCulture, values);

                Assert.IsFalse(result);
            }
示例#6
0
 public void ThrowsIfArg0IsNull()
 {
     SrkStringExtensions.ContainsAny(null, StringComparison.CurrentCulture, new char[0]);
 }