Пример #1
0
        public void Constructor_Should_Fail_On_Unparseable_StartDate()
        {
            var sut = new Ad(
                @"//Start Date
                donald duck
                // End Date
                2099-12-31 08:15
                // Rotation
                20
                // Html
                <p>blah");

            Assert.AreEqual(new DateTime(2015, 10, 21, 16, 0, 0), sut.StartDate);
        }
Пример #2
0
        public void Constructor_Should_Parse_EndDate()
        {
            var sut = new Ad(
                @"//Start Date
                2015-10-21 16:00
                // End Date
                2099-12-31 08:15
                // Rotation
                20
                // Html
                <p>blah");

            Assert.AreEqual(new DateTime(2099, 12, 31, 8, 15, 0), sut.EndDate);
        }
Пример #3
0
        public void Constructor_Should_Fail_On_Unparseable_EndDate()
        {
            var sut = new Ad(
                @"//Start Date
                2015-10-21 16:00
                // End Date
                mickey mouse
                // Rotation
                20
                // Html
                <p>blah");

            Assert.AreEqual(new DateTime(2015, 10, 21, 16, 0, 0), sut.StartDate);
        }
Пример #4
0
        public void Constructor_Should_Fail_On_1_Char_Line()
        {
            var sut = new Ad(@"//Start Date
                2015-10-21 16:00
                // End Date
                2099-12-31 08:15
                // Rotation
                2
                // Html
                <p>blah
                more html");

            Assert.AreEqual("<p>blah\nmore html", sut.Html);
        }
Пример #5
0
        public void Constructor_Should_Parse_Rotation()
        {
            var sut = new Ad(
                @"//Start Date
                2015-10-21 16:00
                // End Date
                2099-12-31 08:15
                // Rotation
                20
                // Html
                <p>blah");

            Assert.AreEqual(20, sut.Rotation);
        }
Пример #6
0
 public void Constructor_Should_Throw_Exception_if_bad_Rotation()
 {
     var sut = new Ad(
         @"//Start Date
         2015-10-21 16:00
         // End Date
         2099-12-31 08:15
         // Rotation
         minnie mouse
         // Html
         <p>blah");
 }
Пример #7
0
        public void Constructor_Should_Throw_Error_If_File_Content_Doesnt_Have_Minimum_4_Non_Comment_Lines()
        {
            var sut = new Ad(
            @"//
            blah
            //
            blah
            //
            blah
            //");

            sut.StartDate = DateTime.Now;
        }
Пример #8
0
        public void Constructor_Should_Read_Remaining_Multiline_File_Contents_into_HTML()
        {
            var sut = new Ad(@"//Start Date
                2015-10-21 16:00
                // End Date
                2099-12-31 08:15
                // Rotation
                20
                // Html
                <p>blah
                more html");

            Assert.AreEqual("<p>blah\nmore html", sut.Html);
        }