예제 #1
0
        public void SubstituteTemplateCollectionAlsoSubstitutesSiteWithGuid()
        {
            //Arrange
            var spWebTemplateCollectionSubstitute = new SPWebTemplateCollectionSubstitute();

            var webTemplates = new List <SPWebTemplateSubstitute>();

            //Act
            spWebTemplateCollectionSubstitute.Returns(webTemplates);

            //Assert
            using (var site = new SPSite(new Guid()))
            {
                Assert.That(site, Is.Not.Null);
            }
        }
예제 #2
0
        public void CanGetWebTemplateFromSubstituteTemplateCollection()
        {
            //Arrange
            var spWebTemplateCollectionSubstitute = new SPWebTemplateCollectionSubstitute();

            var webTemplate = new SPWebTemplateSubstitute();

            var template = new List <SPWebTemplateSubstitute>
            {
                webTemplate
            };

            //Act
            spWebTemplateCollectionSubstitute.Returns(template);

            //Assert
            using (var site = new SPSite("http://SomeURL"))
            {
                Assert.That(site.GetWebTemplates(1033), Contains.Item(webTemplate.SpType));
            }
        }