public void WhenVariablesAreNotEquivalent_ThenEqualsReturnsFalse() { var ref1 = new EnvironmentVariable("NAME", null, true); var ref2 = new EnvironmentVariable("NAME", null, false); Assert.IsFalse(ref1.Equals(ref2)); Assert.IsFalse(ref1.Equals((object)ref2)); Assert.IsFalse(ref1 == ref2); Assert.IsTrue(ref1 != ref2); }
public void WhenVariablesAreSame_ThenEqualsReturnsTrue() { var ref1 = new EnvironmentVariable("NAME", "value", true); var ref2 = ref1; Assert.IsTrue(ref1.Equals(ref2)); Assert.IsTrue(ref1.Equals((object)ref2)); Assert.IsTrue(ref1 == ref2); Assert.IsFalse(ref1 != ref2); }
public void TestEqualsNull() { var ref1 = new EnvironmentVariable("NAME", "value", false); Assert.IsFalse(ref1.Equals(null)); Assert.IsFalse(ref1.Equals((object)null)); Assert.IsFalse(ref1 == null); Assert.IsFalse(null == ref1); Assert.IsTrue(ref1 != null); Assert.IsTrue(null != ref1); }