public void ConsoleBufferChar_equals_test() { var ch1 = new ConsoleBufferChar {Char = ' ', ForegroundColor = ConsoleColor.Blue, BackgroundColor = ConsoleColor.Cyan}; var ch2 = new ConsoleBufferChar {Char = ' ', ForegroundColor = ConsoleColor.Blue, BackgroundColor = ConsoleColor.Cyan}; Assert.IsTrue(ch1 == ch2); Assert.IsTrue(ch1.GetHashCode() == ch2.GetHashCode()); }
public void ConsoleBufferChar_not_equals_test() { var ch1 = new ConsoleBufferChar { Char = ' ', ForegroundColor = ConsoleColor.Blue, BackgroundColor = ConsoleColor.Cyan }; var ch2 = new ConsoleBufferChar { Char = '1', ForegroundColor = ConsoleColor.Blue, BackgroundColor = ConsoleColor.Cyan }; Assert.IsTrue(ch1 != ch2); Assert.IsTrue(ch1.GetHashCode() != ch2.GetHashCode()); // ReSharper disable once SuspiciousTypeConversion.Global Assert.IsFalse(ch1.Equals("")); }