Example #1
0
        public void CreateTestLeaf()
        {
            // Get test tree directory.
            _fullTreePath = _folderLogicHandler.GetFullTreePath(_testingTreeName);
            Directory.CreateDirectory(_fullTreePath);

            // Create tree.
            _fullLeafPath = _folderLogicHandler.GetFullLeafPath(_testingTreeName, _testingLeafName);
            _wordLogicHandler.CreateNewLeaf(_fullLeafPath, _testingLeafName, _testingTreeName);
        }
        public void CreateNewTree_WorksAsExpected()
        {
            ResetHandlers();

            // Arrange - Get tree path.
            var treePath = _folderLogicHandler.GetFullTreePath(_testingTreeName);

            // Act - Create tree.
            _folderLogicHandler.CreateNewTreeFolder(treePath);

            // Assert - Check that file exists, and that its name matches.
            Assert.True(_mockFileSystem.Directory.Exists(treePath));

            var basedirectory  = _mockFileSystem.DirectoryInfo.FromDirectoryName(_baseDirectory);
            var subdirectories = basedirectory.GetDirectories();

            Assert.AreEqual(subdirectories[0].FullName, treePath);
            Assert.True(subdirectories.Length == 1);
        }