public void MonthlyTime_CompareTo() { var zoo = new MonthlyTime(15, 0, 0, 0); var foo = new MonthlyTime(15, 1, 1, 1); var moo = new MonthlyTime(15, 1, 1, 1); var bar = new MonthlyTime(15, 2, 2, 2); Assert.True(foo.CompareTo(bar) == -1); Assert.True(foo.CompareTo(moo) == 0); Assert.True(foo.CompareTo(zoo) == 1); }
public void MonthlyTime_CompareToInvalid() { var did_throw = false; var zoo = new MonthlyTime(15, 0, 0, 0); var boo = new object(); try { zoo.CompareTo(boo); } catch (ArgumentException) { did_throw = true; } Assert.True(did_throw); }