public void should_convert_to_full_domain_entity()
        {
            var id = Guid.NewGuid();
            var name = "test";
            var dto = new SiteConfigDTO {id = id, name = name};

            var config = new SiteConfiguration();
            dto.ToSiteConfiguration(config);

            config.ID.ShouldEqual(id);
            config.Name.ShouldEqual(name);
        }
        public void should_convert_sub_aliases()
        {
            var host1 = "host1";
            var host2 = "host2";
            var dto = new SiteConfigDTO {aliases = new[] {new AliasDTO {host = host1}, new AliasDTO {host = host2}}};

            var config = new SiteConfiguration();
            dto.ToSiteConfiguration(config);
            var aliases = config.GetAliases();

            aliases.First().Host.ShouldEqual(host1);
            aliases.Skip(1).Single().Host.ShouldEqual(host2);
        }
 public void SetUp()
 {
     _config = new SiteConfiguration();
     _model = new TestViewModel();
     _behavior = new set_the_current_site_details_on_the_output_viewmodel(_config);
 }
예제 #4
0
        public void ToSiteConfiguration(SiteConfiguration config)
        {
            config.ID = id;
            config.Name = name;
            config.Host = host;
            config.LanguageDefault = languageDefault;
            config.PageTitleSeparator = pageTitleSeparator;
            config.ThemeDefault = themeDefault;
            config.FavIconUrl = favIconUrl;
            config.ScriptsPath = scriptsPath;
            config.CssPath = cssFilePath;
            config.ImagesPath = imagesPath;
            config.CommentAnonymousStateDefault = commentAnonymousStateDefault;
            config.EmailUsername = emailUsername;
            config.IncludeOpenSearch = includeOpenSearch;
            config.AuthorAutoSubscribe = authorAutoSubscribe;
            config.PostEditTimeout = postEditTimeout;
            config.SEORobots = seoRobots;
            config.GravatarDefault = gravatarDefault;
            config.TrackbacksEnabled = trackbacksEnabled;

            if (aliases != null)
            {
                aliases.Each(a => config.AddAlias(a.ToAlias()));
            }
        }