Пример #1
0
        public void AddLinesToListBoxTest()
        {
            //arrange
            ListBox      box     = new ListBox();
            Display      display = new Display();
            RepeatedLine line1   = new RepeatedLine(3, "This is some content", new List <string> {
                "file1", "file2", "file3"
            });
            RepeatedLine line2 = new RepeatedLine(8, "This is some more content", new List <string> {
                "file2", "file3"
            });

            //act
            display.AddLinesToListBox(box, new List <RepeatedLine> {
                line1, line2
            });
            List <RepeatedLine> actual   = (List <RepeatedLine>)box.DataSource;
            List <RepeatedLine> expected = new List <RepeatedLine> {
                line2, line1
            };

            //assert
            Assert.IsTrue(actual.SequenceEqual(expected));
        }