public void Equals_SameObjects_True() { var process1 = new Process { FileName = "foo", Arguments = "bar", Enabled = false, WindowStyle = ProcessWindowStyle.Maximized }; var process2 = new Process { FileName = "foo", Arguments = "bar", Enabled = false, WindowStyle = ProcessWindowStyle.Maximized }; Assert.AreEqual(process1, process2); }
public void Equals_DifferentObjects_False() { var process1 = new Process { FileName = "foo", Arguments = "bar", Enabled = false, WindowStyle = ProcessWindowStyle.Maximized }; var process2 = new Process { FileName = "bar", Arguments = "baz", Enabled = true, WindowStyle = ProcessWindowStyle.Maximized }; Assert.AreNotEqual(process1, process2); }
public void GetHashCode_DifferentObjects_DifferentHashCodes() { var process1 = new Process { FileName = "foo", Arguments = "bar", Enabled = false, WindowStyle = ProcessWindowStyle.Maximized }; var process2 = new Process { FileName = "bar", Arguments = "baz", Enabled = true, WindowStyle = ProcessWindowStyle.Maximized }; Assert.IsTrue(process1.GetHashCode() > 0); Assert.IsTrue(process2.GetHashCode() > 0); Assert.IsFalse(process1.GetHashCode() == process2.GetHashCode()); }