示例#1
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();
            }
        }
示例#2
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();
            }
        }