Example #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 "));
        }
Example #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));
        }
        public void StringComparer_CaseInsensitive_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer(StringComparisonOptions.CaseInsensitive);

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

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

            Assert.IsTrue(comparer.Equals("foo", "foo"));
        }
        public void StringComparer_NoOptions_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer();

            Assert.IsTrue(comparer.Equals("foo", "foo"));
        }
        public void StringComparer_IgnoreWhitespace_EqualReturnsTrue()
        {
            var comparer = new SoftStringEqualityComparer(StringComparisonOptions.IgnoreWhitespace);

            Assert.IsTrue(comparer.Equals("foo", "foo"));
            Assert.IsTrue(comparer.Equals("foo", " foo "));
        }
        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));
        }
        public void StringComparer_NoOptions_NotEqualReturnsFalse()
        {
            var comparer = new SoftStringEqualityComparer();

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