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