本文整理汇总了C#中Clock.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Clock.ToString方法的具体用法?C# Clock.ToString怎么用?C# Clock.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Clock
的用法示例。
在下文中一共展示了Clock.ToString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Sixty_minutes_is_next_hour
public void Sixty_minutes_is_next_hour()
{
var clock = new Clock(1, 60);
Assert.That(clock.ToString(), Is.EqualTo("02:00"));
}
示例2: Midnight_is_zero_hundred_hours
public void Midnight_is_zero_hundred_hours()
{
var clock = new Clock(24);
Assert.That(clock.ToString(), Is.EqualTo("00:00"));
}
示例3: Can_add_minutes
public void Can_add_minutes()
{
var clock = new Clock(10).Add(3);
Assert.That(clock.ToString(), Is.EqualTo("10:03"));
}
示例4: Can_subtract_over_an_hour
public void Can_subtract_over_an_hour()
{
var clock = new Clock(10, 3).Subtract(70);
Assert.That(clock.ToString(), Is.EqualTo("08:53"));
}
示例5: Can_subtract_to_previous_hour
public void Can_subtract_to_previous_hour()
{
var clock = new Clock(10, 3).Subtract(30);
Assert.That(clock.ToString(), Is.EqualTo("09:33"));
}
示例6: Can_subtract_minutes
public void Can_subtract_minutes()
{
var clock = new Clock(10, 3).Subtract(3);
Assert.That(clock.ToString(), Is.EqualTo("10:00"));
}
示例7: Can_add_over_more_than_one_day
public void Can_add_over_more_than_one_day()
{
var clock = new Clock(10).Add(7224);
Assert.That(clock.ToString(), Is.EqualTo("10:24"));
}
示例8: Can_add_over_an_hour
public void Can_add_over_an_hour()
{
var clock = new Clock(10).Add(63);
Assert.That(clock.ToString(), Is.EqualTo("11:03"));
}
示例9: Wraps_around_midnight_backwards
public void Wraps_around_midnight_backwards()
{
var clock = new Clock(0, 1).Subtract(2);
Assert.That(clock.ToString(), Is.EqualTo("23:59"));
}
示例10: Wraps_around_midnight
public void Wraps_around_midnight()
{
var clock = new Clock(23, 59).Add(2);
Assert.That(clock.ToString(), Is.EqualTo("00:01"));
}