public void Equals_SuppliedObjectIsNull_ResultIsFalse() { // Arrange var object1 = new SystemInformation { MachineName = Environment.MachineName, Timestamp = DateTime.UtcNow, SystemPerformance = new SystemPerformanceData() }; SystemInformation object2 = null; // Act bool result = object1.Equals(object2); // Assert Assert.IsFalse(result); }
public void Equals_TwoIdenticalInitializedObjects_ResultIsTrue() { // Arrange var timestamp = DateTime.UtcNow; var object1 = new SystemInformation { MachineName = Environment.MachineName, Timestamp = timestamp, SystemPerformance = new SystemPerformanceData() }; var object2 = new SystemInformation { MachineName = Environment.MachineName, Timestamp = timestamp, SystemPerformance = new SystemPerformanceData() }; // Act bool result = object1.Equals(object2); // Assert Assert.IsTrue(result); }
public void Equals_TwoUninitializedObjects_ResultIsTrue() { // Arrange var object1 = new SystemInformation(); var object2 = new SystemInformation(); // Act bool result = object1.Equals(object2); // Assert Assert.IsTrue(result); }
public void Equals_TwoIdenticalObjectsWithDifferentCasing_ResultIsTrue() { // Arrange var timestamp = DateTime.UtcNow; var object1 = new SystemInformation { MachineName = Environment.MachineName.ToLower(), Timestamp = timestamp, SystemPerformance = new SystemPerformanceData() }; var object2 = new SystemInformation { MachineName = Environment.MachineName.ToUpper(), Timestamp = timestamp, SystemPerformance = new SystemPerformanceData() }; // Act bool result = object1.Equals(object2); // Assert Assert.IsTrue(result); }