public void WhenStartTimeGreaterThanEnd_ThenThrowException()
            {
                var start = new SubRipTimeSpan("00:01:20,001");
                var end   = new SubRipTimeSpan("00:01:20,000");

                Assert.Throws <ArgumentException>(() => _ = new SubRipDuration(start, end));
            }
            public void WhenValid_ThenSetProperties()
            {
                var sut = new SubRipDuration("00:01:20,000 --> 00:01:23,000");

                Assert.That(sut.Start.ToString(), Is.EqualTo("00:01:20,000"));
                Assert.That(sut.End.ToString(), Is.EqualTo("00:01:23,000"));
            }
            public void WhenValid_ThenSetProperties()
            {
                var start = new SubRipTimeSpan("00:01:20,000");
                var end   = new SubRipTimeSpan("00:01:23,000");

                var sut = new SubRipDuration(start, end);

                Assert.That(sut.Start.ToString(), Is.EqualTo("00:01:20,000"));
                Assert.That(sut.End.ToString(), Is.EqualTo("00:01:23,000"));
                Assert.That(sut.TotalActiveTime.ToString(), Is.EqualTo("00:00:03,000"));
            }
Exemplo n.º 4
0
 public void SetUp()
 {
     _duration = new SubRipDuration(new SubRipTimeSpan(0, 1, 20, 0), new SubRipTimeSpan(0, 1, 23, 500));
 }
            public void WhenStartAndEndAreEqual_ThenReturnTimeSpan()
            {
                var sut = new SubRipDuration("00:01:20,000 --> 00:01:20,000");

                Assert.That(sut.TotalActiveTime.TotalMilliseconds, Is.EqualTo(0));
            }
            public void WhenStartLessThanEnd_ThenReturnTimeSpan()
            {
                var sut = new SubRipDuration("00:01:20,000 --> 00:01:23,000");

                Assert.That(sut.TotalActiveTime.ToString(), Is.EqualTo("00:00:03,000"));
            }
 public void WhenStartTimeGreaterThanEnd_ThenThrowException()
 {
     Assert.Throws <ArgumentException>(() => _ = new SubRipDuration("00:01:20,001 --> 00:01:20,000"));
 }
 public void WhenInvalid_ThenThrowException(string duration)
 {
     Assert.Throws <ArgumentException>(() => _ = new SubRipDuration(duration));
 }