public void GetHashCode_IsEqual_ForIncidentsWithSameIDButDifferentValues() { Incident incident2 = new Incident(clock, incidentChangeListener, "ID 1", 13, "Location2", new DateTime(2010, 2, 1, 9, 30, 0), "MyName", "AnotherType", "AnotherStatus", "Large", 7); Assert.AreEqual(incident.GetHashCode(), incident2.GetHashCode()); }
public void GetHashCode_IsEqual_ForIncidentsWithSameID() { Incident incident2 = new Incident(clock, incidentChangeListener, "ID 1", 13, "Location", new DateTime(2009, 2, 1, 9, 30, 0), "Name", "Type", "Status", "Size", 150); Assert.AreEqual(incident.GetHashCode(), incident2.GetHashCode()); }
protected override void SetUp() { clock = NewMock<IClock>(); incidentChangeListener = NewMock<IIncidentChangeListener>(); incident = new Incident(clock, incidentChangeListener, "ID 1", 13, "Location", new DateTime(2009, 2, 1, 9, 30, 0), "Name", "Type", "Status", "Size", 150); }
public void Compare() { Incident incident2 = new Incident(clock, incidentChangeListener, "ID 2", 13, "Location", new DateTime(2009, 2, 1, 9, 30, 0), "Name", "Type", "Status", "Size", 150); Assert.IsTrue(incident.CompareTo(incident) == 0); Assert.IsTrue(incident.CompareTo(incident2) < 0); Assert.IsTrue(incident2.CompareTo(incident) > 0); }
private int Compare(Incident incident) { return incidentID.CompareTo(incident.incidentID); }
private int Compare(Incident incident) { return(incidentID.CompareTo(incident.incidentID)); }