public void WhenCalled_ThenReturnsFormatted() { var sut = new SonosTimeSpan(1, 2, 3); var result = sut.ToString(); Assert.That(result, Is.EqualTo("01:02:03")); }
public void WhenHoursAndMinutesAndSecondsSpecified_ThenSetProperties() { var sut = new SonosTimeSpan(1, 3, 10); Assert.That(sut.Hours, Is.EqualTo(1)); Assert.That(sut.Minutes, Is.EqualTo(3)); Assert.That(sut.Seconds, Is.EqualTo(10)); }
public void WhenNoneSpecified_ThenSetToZero() { var sut = new SonosTimeSpan(); Assert.That(sut.Hours, Is.EqualTo(0)); Assert.That(sut.Minutes, Is.EqualTo(0)); Assert.That(sut.Seconds, Is.EqualTo(0)); }
public void WhenCalled_ThenReturnsAsTimespan() { var sut = new SonosTimeSpan(1, 2, 3); var result = sut.ToTimeSpan(); Assert.That(result.Hours, Is.EqualTo(1)); Assert.That(result.Minutes, Is.EqualTo(2)); Assert.That(result.Seconds, Is.EqualTo(3)); }
public void WhenArgIsTimespan_ThenSetProperties() { var ts = new TimeSpan(1, 2, 3); var sut = new SonosTimeSpan(ts); Assert.That(sut.Hours, Is.EqualTo(ts.Hours)); Assert.That(sut.Minutes, Is.EqualTo(ts.Minutes)); Assert.That(sut.Seconds, Is.EqualTo(ts.Seconds)); }
public async Task SeekTimeAsync(SonosTimeSpan time) { await _avTransportService.SeekAsync(new SeekUnit(SeekUnitType.Time), time.ToString()); }