Esempio n. 1
0
        public void ShouldCreateAndSwitchToSimpleSiteContext()
        {
            // Arrange
              var website = new TSiteContext("website");

              // Act
              using (new SiteContextSwitcher(website))
              {
            // Assert
            Context.Site.Name.Should().Be("website");
              }
        }
Esempio n. 2
0
        public void ShouldCreateAndSwitchToSiteContextWithCustomPropeties()
        {
            using (new TTree())
              {
            // Arrange
            var website = new TSiteContext( new StringDictionary { { "name", "webshop" }, { "content", "master" }, { "settingsItem", "/settings" } });

            // Act
            using (new SiteContextSwitcher(website))
            {
              var site = Context.Site;

              // Assert
              site.Name.Should().Be("webshop");
              site.ContentDatabase.Name.Should().Be("master");
              site.Properties["settingsItem"].Should().Be("/settings");
            }
              }
        }