Example #1
0
        public void Creates_Sequential_Folders()
        {
            // Arrange

            // Create an empty folder, representing the .sonarqube/out folder
            var root = TestUtils.CreateTestSpecificFolder(TestContext);
            var task = new MakeUniqueDir { Path = root };

            // Act
            task.Execute(); // create "0"

            // Assert
            Assert.IsTrue(Directory.Exists(Path.Combine(root, "0")));
            Assert.AreEqual("0", task.UniqueName);
            Assert.AreEqual(Path.Combine(root, "0"), task.UniquePath);
        }
        public void Creates_Sequential_Folders()
        {
            // Arrange

            // Create an empty folder, representing the .sonarqube/out folder
            var root = TestUtils.CreateTestSpecificFolderWithSubPaths(TestContext);
            var task = new MakeUniqueDir {
                Path = root
            };

            // Act
            task.Execute(); // create "0"

            // Assert
            Directory.Exists(Path.Combine(root, "0")).Should().BeTrue();
            task.UniqueName.Should().Be("0");
            task.UniquePath.Should().Be(Path.Combine(root, "0"));
        }
Example #3
0
        public void Creates_Sequential_Folders_Some_Already_Exist()
        {
            // Arrange

            // Create an empty folder, representing the .sonarqube/out folder
            var root = TestUtils.CreateTestSpecificFolder(TestContext);

            // Simulate a folder was already created
            Directory.CreateDirectory(Path.Combine(root, "0"));
            Directory.CreateDirectory(Path.Combine(root, "1"));
            Directory.CreateDirectory(Path.Combine(root, "2"));

            var task = new MakeUniqueDir {
                Path = root
            };

            // Act
            task.Execute(); // create "3"

            // Assert
            Directory.Exists(Path.Combine(root, "3")).Should().BeTrue();
            task.UniqueName.Should().Be("3");
            task.UniquePath.Should().Be(Path.Combine(root, "3"));
        }