public void GetNewsItems_WithValidNewsRootAndNoNewsItems_ReturnsEmptyList()
        {
            // Arrange
            IItemProvider   itemProvider    = ItemProviderFactory.CreateItemProviderWithNewsItemRootWithoutNewsItems();
            NewsItemService newsItemService = GetNewsItemService(itemProvider);

            // Act
            var result = newsItemService.GetNewsItems();

            // Assert
            result.Should().BeEmpty();
        }
        public void GetNewsItems_WithValidNewsRootAndNewsItems_ReturnsNewsItems()
        {
            // Arrange
            var newsItemService = new NewsItemService
            {
                Database = FakeSitecoreItemFactory.CreateDbWithNewsRootAndWithNewsItems()
            };

            // Act
            var result = newsItemService.GetNewsItems();

            // Assert
            result.Should().NotBeEmpty();
        }
        public void GetNewsItems_WithInvalidNewsRoot_ReturnsEmptyList()
        {
            // Arrange
            var newsItemService = new NewsItemService
            {
                Database = FakeSitecoreItemFactory.CreateDbWithoutNewsRoot()
            };

            // Act
            var result = newsItemService.GetNewsItems();

            // Assert
            result.Should().BeEmpty();
        }
예제 #4
0
        public void GetNewsItems_WithValidNewsRootAndNewsItems_ReturnsNewsItems()
        {
            // Arrange
            var newsItemService = new NewsItemService();

            using (var db = FakeDbFactory.CreateDbWithNewsRootAndWithNewsItems())
            {
                // Act
                var result = newsItemService.GetNewsItems();

                // Assert
                result.Should().NotBeEmpty();
            }
        }
예제 #5
0
        public void GetNewsItems_WithInvalidNewsRoot_ReturnsEmptyList()
        {
            // Arrange
            var newsItemService = new NewsItemService();

            using (var db = FakeDbFactory.CreateDbWithoutNewsRoot())
            {
                // Act
                var result = newsItemService.GetNewsItems();

                // Assert
                result.Should().BeEmpty();
            }
        }
예제 #6
0
 public NewsItemController(IMapper mapper)
 {
     _newsItemService = new NewsItemService(mapper);
 }
 public NewsItemController(IMapper mapper)
 {
     _newsItemService     = new NewsItemService(mapper);
     _authorizationHeader = "dmVyeSBzZWNyZXQ=";
 }
 public NewsItemController(IMapper mapper)
 {
     _newsItemService       = new NewsItemService(mapper);
     _authenticationService = new AuthenticationService();
 }
 public TechnicalRadiationController() // Constructor
 {
     _categoryService = new CategoryService();
     _newsItemService = new NewsItemService();
     _authorService   = new AuthorService();
 }