Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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());
        }