public void GetNodes_RepositoryReturnsNull_ReturnsEmptyList()
        {
            // Arrange
            var treeRepository = Substitute.For <ICachedTreeRepository>();

            treeRepository.GetAll().Returns((List <TreeNode>)null);
            var cachedTreeController = new CachedTreeController(treeRepository);

            // Act
            IEnumerable <TreeNode> nodes = cachedTreeController.GetNodes().Value;

            // Assert
            Assert.That(nodes, Is.Empty);
        }
        public void GetNodes_NodesExists_ReturnsNodes()
        {
            // Arrange
            var treeRepository = Substitute.For <ICachedTreeRepository>();
            var expectedNodes  = new List <TreeNode>
            {
                new TreeNode
                {
                    Id        = Guid.NewGuid(),
                    IsDeleted = true,
                    ParentId  = Guid.NewGuid(),
                    Value     = "text"
                }
            };

            treeRepository.GetAll().Returns(expectedNodes);
            var cachedTreeController = new CachedTreeController(treeRepository);

            // Act
            IEnumerable <TreeNode> nodes = cachedTreeController.GetNodes().Value;

            // Assert
            Assert.That(nodes, Is.EquivalentTo(expectedNodes));
        }