예제 #1
0
            public void WhenCalled_ThenReturnsFormatted()
            {
                var sut = new SonosTimeSpan(1, 2, 3);

                var result = sut.ToString();

                Assert.That(result, Is.EqualTo("01:02:03"));
            }
예제 #2
0
            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));
            }
예제 #3
0
            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));
            }
예제 #4
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));
            }
예제 #5
0
            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));
            }
예제 #6
0
 public async Task SeekTimeAsync(SonosTimeSpan time)
 {
     await _avTransportService.SeekAsync(new SeekUnit(SeekUnitType.Time), time.ToString());
 }