コード例 #1
0
        public void TestIdentityAndEquality()
        {
            var temp1 = new ProcessingSettings();

            temp1.Default();

            var temp2 = new ProcessingSettings();

            temp2.Default();

            ProcessingSettings temp3 = (ProcessingSettings)temp2.Clone();


            Assert.IsFalse(temp1.Equals(null));

            Assert.IsTrue(temp1.Equals(temp1));

            Assert.IsTrue(temp2.Equals(temp1));
            Assert.IsTrue(temp1.Equals(temp2));

            Assert.IsNotNull(temp3, "clone must return non-null reference!");
            Assert.AreNotSame(temp3, temp2, "clone must return new instance!");

            Assert.IsFalse(temp3 == temp2, "identy test failed");
            Assert.IsTrue(temp3 != temp2, "identy test failed");

            Assert.IsTrue(temp2.Equals(temp3));
            Assert.IsTrue(temp3.Equals(temp2));

            Assert.IsTrue(temp1.Equals(temp3));
            Assert.IsTrue(temp3.Equals(temp1));
        }
コード例 #2
0
        public void TestIdentityAndEquality()
        {
            var temp1 = new ProcessingSettings();

            temp1.Default();

            var temp2 = new ProcessingSettings();

            temp2.Default();

            temp2.RejectUsingMinMaxNNTime    = temp1.RejectUsingMinMaxNNTime = true;
            temp2.RejectUsingRelativeNNDelta = temp1.RejectUsingRelativeNNDelta = false;

            temp2.MaxIntervalDeltaRelative = temp1.MaxIntervalDeltaRelative = 20.0f;
            temp2.MaxIntervalMilliseconds  = temp1.MaxIntervalMilliseconds = 10.0f;
            temp2.MinIntervalMilliseconds  = temp1.MinIntervalMilliseconds = 15.0f;

            ProcessingSettings temp3 = (ProcessingSettings)temp2.Clone();

            Assert.IsFalse(temp1.Equals(null));

            Assert.IsTrue(temp1.Equals(temp1));

            Assert.IsTrue(temp2.Equals(temp1));
            Assert.IsTrue(temp1.Equals(temp2));

            Assert.IsNotNull(temp3, "clone must return non-null reference!");
            Assert.AreNotSame(temp3, temp2, "clone must return new instance!");

            Assert.IsFalse(temp3 == temp2, "identy test failed");
            Assert.IsTrue(temp3 != temp2, "identy test failed");

            Assert.IsTrue(temp2.Equals(temp3));
            Assert.IsTrue(temp3.Equals(temp2));

            Assert.IsTrue(temp1.Equals(temp3));
            Assert.IsTrue(temp3.Equals(temp1));
        }