public void TestBookmarkEquality() { Bookmark b1 = new Bookmark("test1", "test2", "test3"); Bookmark b2 = new Bookmark("test1", "test2", "test3") { Description = "test4" }; Bookmark b3 = new Bookmark("testA", "testB", "testC"); Bookmark b4 = new Bookmark("testA", "testB", "testC") { IgnoreFilePattern = "*.txt", WholeWord = true, Multiline = false, IncludeArchive = true, }; Bookmark b5 = new Bookmark("testA", "testB", "testC") { IgnoreFilePattern = "*.txt", WholeWord = true, Multiline = false, IncludeArchive = true, }; Bookmark b6 = new Bookmark("testA", "testB", "testC") { IgnoreFilePattern = "*.txt", }; Assert.False(b1 == null); Assert.False(b1.Equals(null)); Assert.False(Bookmark.Equals(null, b1)); Assert.False(Bookmark.Equals(b1, null)); Assert.True(b1 == b2); Assert.True(b1.Equals(b2)); Assert.False(b1 == b3); Assert.False(b1.Equals(b3)); Assert.True(b1 != b3); Assert.True(b4 == b5); Assert.False(b4 == b6); }
public void HandlesNullCorrectly() { var bookmark = new Bookmark(); Assert.False(bookmark.Equals(null)); }