Exemple #1
0
        public void ctor_NullBlogSettings_ShouldNotThrow()
        {
            // Arrange
            var repository = new FakeRepository();

            // Act
            var service = new BlogService(repository, blogSettings: null);

            // Assert
            Assert.NotNull(service);
        }
        public static BlogService Create(
            IEnumerable<BlogPost> blogPosts = null,
            IEnumerable<BlogMeta> blogMetas = null,
            params BlogSetting[] blogSettings)
        {
            var repository = new FakeRepository(blogPosts, blogMetas);

            blogSettings = (blogSettings != null && blogSettings.Any())
                               ? blogSettings
                               : BlogSettingTestData.CreateCollection().ToArray();

            var service = new BlogService(repository, blogSettings);
            return service;
        }