Пример #1
0
        public void StringComparer_CaseInsensitiveIgnoreWhitespace_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer(StringComparisonOptions.CaseInsensitive | StringComparisonOptions.IgnoreWhitespace);

            Assert.IsTrue(comparer.Equals("foo", "foo"));
            Assert.IsTrue(comparer.Equals("foo", " FOO "));
        }
Пример #2
0
        public void StringComparer_NullEqualsAnything_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer(StringComparisonOptions.CaseInsensitive | StringComparisonOptions.IgnoreWhitespace, true);

            Assert.IsTrue(comparer.Equals("foo", "foo"));
            Assert.IsTrue(comparer.Equals("foo", null));
        }
Пример #3
0
        public void StringComparer_CaseInsensitive_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer(StringComparisonOptions.CaseInsensitive);

            Assert.IsTrue(comparer.Equals("foo", "foo"));
            Assert.IsTrue(comparer.Equals("foo", "FOO"));
        }
Пример #4
0
        public void StringComparer_NoOptions_NotEqualReturnsFalse()
        {
            var comparer = new SoftStringEqualityComparer();

            Assert.IsFalse(comparer.Equals("foo", "bar"));
        }
Пример #5
0
        public void StringComparer_NoOptions_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer();

            Assert.IsTrue(comparer.Equals("foo", "foo"));
        }
Пример #6
0
        public void StringComparer_NoOptions_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer();

            Assert.IsTrue(comparer.Equals("foo", "foo"));
        }
Пример #7
0
        public void StringComparer_IgnoreWhitespace_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer(StringComparisonOptions.IgnoreWhitespace);

            Assert.IsTrue(comparer.Equals("foo", "foo"));
            Assert.IsTrue(comparer.Equals("foo", " foo "));
        }
Пример #8
0
        public void StringComparer_NullEqualsAnything_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer(StringComparisonOptions.CaseInsensitive | StringComparisonOptions.IgnoreWhitespace, true);

            Assert.IsTrue(comparer.Equals("foo", "foo"));
            Assert.IsTrue(comparer.Equals("foo", null));
        }
Пример #9
0
        public void StringComparer_NoOptions_NotEqualReturnsFalse()
        {
            var comparer = new SoftStringEqualityComparer();

            Assert.IsFalse(comparer.Equals("foo", "bar"));
        }