public void WhenEntriesInNonSequentialOrder_ThenSort()
            {
                var entry1 = TestSubRipEntryFactory.Create1();
                var entry2 = TestSubRipEntryFactory.Create2();
                var entry3 = TestSubRipEntryFactory.Create3();
                var entry4 = TestSubRipEntryFactory.Create4();
                var entry5 = TestSubRipEntryFactory.Create5();

                var entries = new List <SubRipEntry>
                {
                    entry2, entry1, entry3, entry5, entry4
                };

                var sut = new SubRipFile(FileName, entries);

                sut.Sort();

                Assert.That(sut.Entries.First().OrderId, Is.EqualTo(entry1.OrderId));
                Assert.That(sut.Entries.First().Text, Is.EqualTo(entry1.Text));

                Assert.That(sut.Entries.Second().OrderId, Is.EqualTo(entry2.OrderId));
                Assert.That(sut.Entries.Second().Text, Is.EqualTo(entry2.Text));

                Assert.That(sut.Entries.Third().OrderId, Is.EqualTo(entry3.OrderId));
                Assert.That(sut.Entries.Third().Text, Is.EqualTo(entry3.Text));

                Assert.That(sut.Entries.Fourth().OrderId, Is.EqualTo(entry4.OrderId));
                Assert.That(sut.Entries.Fourth().Text, Is.EqualTo(entry4.Text));

                Assert.That(sut.Entries.Fifth().OrderId, Is.EqualTo(entry5.OrderId));
                Assert.That(sut.Entries.Fifth().Text, Is.EqualTo(entry5.Text));
            }
            public void SetUp()
            {
                // "01:40:55,758 --> 01:40:58,426" => Duration = {00:00:02,668}
                _entry1 = TestSubRipEntryFactory.Create1();

                // "01:40:58,677 --> 01:41:02,013" => Duration = {00:00:03,336}
                _entry2 = TestSubRipEntryFactory.Create2();
            }
            public void WhenOneEntry_ThenDoNothing()
            {
                var subRipEntry = TestSubRipEntryFactory.Create1();

                var sut = new SubRipFile(FileName, new List <SubRipEntry>
                {
                    subRipEntry
                });

                sut.Sort();

                Assert.That(sut.Entries.First().Text, Is.EqualTo(subRipEntry.Text));
            }
            public void WhenTextContainsReturnChars_ThenDoNothing(string text)
            {
                var entry = TestSubRipEntryFactory.Create1();

                entry.Text = text;

                var sut = new SubRipFile(FileName, new List <SubRipEntry> {
                    entry
                });

                sut.SetTextLineMaxLength(20);

                Assert.That(sut.Entries.Single().Text, Is.EqualTo(text));
            }
            public void SetUp()
            {
                // "01:40:55,758 --> 01:40:58,426"
                var entry1 = TestSubRipEntryFactory.Create1();

                // "01:40:58,677 --> 01:41:02,013"
                var entry2 = TestSubRipEntryFactory.Create2();

                var entries = new List <SubRipEntry> {
                    entry1, entry2
                };

                _sut = new SubRipFile(FileName, entries);
            }
 public void SetUp()
 {
     _entry1 = TestSubRipEntryFactory.Create1();
     _entry2 = TestSubRipEntryFactory.Create2();
     _entry3 = TestSubRipEntryFactory.Create2();
 }