public static BlogSyncService Create( IBlogSource blogSource = null, IDataStorage dataStorage = null, IEnumerable<BlogSetting> blogSettings = null) { blogSource = blogSource ?? new FakeBlogSource(); dataStorage = dataStorage ?? new FakeDataStorage(); blogSettings = blogSettings ?? BlogSettingTestData.CreateCollection(); var service = new BlogSyncService(blogSource, dataStorage, blogSettings.ToArray()); return service; }
private static BlogSyncService GetBlogSyncService(IDocumentStore documentStore) { if (documentStore == null) { throw new ArgumentNullException(nameof(documentStore)); } var blogSource = AppSettingsFactory.BuildBlogSource((username, password) => new BloggerBlogSource(password)); var dataStorage = new RavenDbDataStorage(documentStore); var syncConfig = new BlogSyncConfiguration(blogSource, dataStorage, blogSettings: BlogSettingsLazy.Value); syncConfig.TransformersProvider.Transformers.Clear(); var blogSync = new BlogSyncService(syncConfig); return(blogSync); }