public void GetDurationTest() { MeetingNode meeting0 = new MeetingNode(mTitle, mID, "0001/01/01 00:00:00", "0001/01/01 00:00:00", PID, Attendents); MeetingNode meeting = new MeetingNode(mTitle, mID, sTime, eTime, PID, Attendents); //test empty TimeSpan expectedspan0 = new TimeSpan(0, 0, 0, 0); TimeSpan actualspan0 = meeting0.GetDuration(); Assert.AreEqual(expectedspan0, actualspan0, "Actual duration does not equal to empty"); //test get less than 1 day TimeSpan expectedspan1 = new TimeSpan(0, 1, 40, 0); TimeSpan actualspan1 = meeting.GetDuration(); Assert.AreEqual(expectedspan1, actualspan1, "Actual duration does not equal to 0 day 1 hour 40 mins 0 second"); //test get more than 1 day MeetingNode meeting2 = new MeetingNode(mTitle, mID, "2017/04/02 14:00:00", "2017/4/3 19:30:00", PID, Attendents); TimeSpan expectedspan2 = new TimeSpan(1, 5, 30, 0); TimeSpan actualspan2 = meeting2.GetDuration(); Assert.AreEqual(expectedspan2, actualspan2, "Actual duration does not equal to 1 day 5 hour 30 mins 0 second"); }