public void SetUp() { _siteConfiguration = new SiteConfiguration { TwitterUserName = "******", TwitterPassword = "******", }; _twitterClient = MockRepository.GenerateStub<ITwitterClient>(); _tinyUrlService = MockRepository.GenerateStub<ITinyUrlService>(); _urlResolver = MockRepository.GenerateStub<IUrlResolver>(); _twitterService = new TwitterService(_siteConfiguration, _twitterClient, _tinyUrlService, _urlResolver); _user = new User { TwitterUserName = "******", }; _post = new Post { User = _user, Title = "Test title", }; }
public TwitterService(SiteConfiguration siteConfiguration, ITwitterClient twitterClient, ITinyUrlService tinyUrlService, IUrlResolver urlResolver) { _urlResolver = urlResolver; _tinyUrlService = tinyUrlService; _siteConfiguration = siteConfiguration; _twitterClient = twitterClient; }
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); }
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; config.TwitterUserName = twitterUserName; config.TwitterPassword = twitterPassword; if (aliases != null) { aliases.Each(a => config.AddAlias(a.ToAlias())); } }