Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 private int Compare(Incident incident)
 {
     return incidentID.CompareTo(incident.incidentID);
 }
Esempio n. 6
0
 private int Compare(Incident incident)
 {
     return(incidentID.CompareTo(incident.incidentID));
 }