public void be_able_to_be_compared_to_times_greater_than_it() { var time1 = new TwentyFourHourTime(10, 45); var time2 = new TwentyFourHourTime(09, 45); Assert.True(time1.IsGreaterThan(time2)); }
public void not_be_equal_when_different_to_another_time_using_hash_code_comparison() { var time1 = new TwentyFourHourTime(10, 45); var time2 = new TwentyFourHourTime(11, 45); Assert.True(time1.GetHashCode() != time2.GetHashCode()); }
public void not_be_equal_when_different_to_another_time_that_isnt_explicitly_typed() { var time1 = new TwentyFourHourTime(10, 45); var time2 = (object)new TwentyFourHourTime(11, 45); Assert.False(time1.Equals(time2)); }
public void not_be_equal_when_different_to_another_time_using_not_equals_operator() { var time1 = new TwentyFourHourTime(10, 45); var time2 = new TwentyFourHourTime(09, 45); Assert.True(time1 != time2); }
public void be_equal_when_the_same_as_another_time_using_equality_operator() { var time1 = new TwentyFourHourTime(10, 45); var time2 = new TwentyFourHourTime(10, 45); Assert.True(time1 == time2); }
public void be_equal_when_the_same_as_another_time_using_hash_code_comparison() { var time1 = new TwentyFourHourTime(10, 45); var time2 = new TwentyFourHourTime(10, 45); Assert.True(time1.GetHashCode() == time2.GetHashCode()); }
public void be_able_to_be_created_from_a_datetime() { var time1 = new TwentyFourHourTime(10, 45); var time2 = TwentyFourHourTime.From(new DateTime(2017, 5, 1, 10, 45, 0)); Assert.True(time1.Equals(time2)); }
public void be_equal_when_same_another_time_that_isnt_explicitly_typed() { var time1 = new TwentyFourHourTime(10, 45); var time2 = (object)new TwentyFourHourTime(10, 45); Assert.True(time1.Equals(time2)); }
public void be_equal_when_the_same_as_another_time_when_explicitly_typed() { var time1 = new TwentyFourHourTime(10, 45); var time2 = new TwentyFourHourTime(10, 45); Assert.True(time1.Equals(time2)); }
public void be_able_to_be_compared_to_times_less_than_or_equal_to_it_using_operator() { var time1 = new TwentyFourHourTime(09, 44); var time2 = new TwentyFourHourTime(09, 45); Assert.True(time1 <= time2); }
public void be_able_to_be_compared_to_times_greater_than_it_using_operator() { var time1 = new TwentyFourHourTime(10, 45); var time2 = new TwentyFourHourTime(09, 45); Assert.True(time1 > time2); }
public void be_able_to_be_compared_to_times_less_than_it() { var time1 = new TwentyFourHourTime(08, 45); var time2 = new TwentyFourHourTime(09, 45); Assert.True(time1.IsLessThan(time2)); }
public void be_able_to_determine_whether_not_between_two_other_times(int minutes) { var startTime = new TwentyFourHourTime(19, 15); var endTime = new TwentyFourHourTime(19, 30); var timeInRange = new TwentyFourHourTime(19, minutes); Assert.False(timeInRange.IsBetween(startTime, endTime)); }
public void be_able_to_convert_itself_to_correct_string_representation() { var time = new TwentyFourHourTime(9, 30); Assert.Equal("09:30", time.ToString()); }