Пример #1
0
        public void PreFilterEmptyCollection()
        {
            WebPagesContainer cnt = new WebPagesContainer();

            TestFixture.WebPageLogic.PrefilterModel(cnt);
            // just assume no exception and the list is still empty
            cnt.WebPages.Should().BeEmpty();
        }
Пример #2
0
        public void PreFilterNullCollection()
        {
            WebPagesContainer cnt = new WebPagesContainer();

            // explicitly set the webpages to null
            cnt.WebPages = null;

            TestFixture.WebPageLogic.PrefilterModel(cnt);
            // just assume no exception and the list property is still null
            cnt.WebPages.Should().BeNull();
        }
Пример #3
0
        public void PreFilterCollection()
        {
            WebPagesContainer cnt = new WebPagesContainer();

            cnt.WebPages.Add(new VmWebPage()
            {
                Name = "TestOne", UrlAddress = "http://www.someurl.com"
            });
            cnt.WebPages.Add(new VmWebPage()
            {
                Name = "TestTwo", UrlAddress = "http://www.someurl2.com"
            });
            cnt.WebPages.Add(new VmWebPage()
            {
                Name = null, UrlAddress = null
            });

            TestFixture.WebPageLogic.PrefilterModel(cnt);
            // the instance with null values should have been removed
            cnt.WebPages.Should().HaveCount(2);
        }