public void ValidateAnnouncement_InvalidSection_ReturnsFalseWithError()
        {
            var validator   = new AnnouncementValidator();
            var modelErrors = new MockErrorCollection();
            var result      = validator.ValidateAnnouncement
                              (
                new Classroom()
            {
                Sections = new List <Section>()
            },
                new Announcement()
            {
                Sections = Collections.CreateList
                           (
                    new AnnouncementSection()
                {
                    SectionId = 1
                }
                           )
            },
                modelErrors
                              );

            Assert.False(result);
            Assert.True(modelErrors.VerifyErrors("Sections"));
        }
        public void ValidateAnnouncement_ValidSections_ReturnsTrueWithNoError()
        {
            var validator   = new AnnouncementValidator();
            var modelErrors = new MockErrorCollection();
            var result      = validator.ValidateAnnouncement
                              (
                new Classroom()
            {
                Sections = Collections.CreateList
                           (
                    new Section()
                {
                    Id = 1
                }
                           )
            },
                new Announcement()
            {
                Sections = Collections.CreateList
                           (
                    new AnnouncementSection()
                {
                    SectionId = 1
                }
                           )
            },
                modelErrors
                              );

            Assert.True(result);
            Assert.False(modelErrors.HasErrors);
        }