Ejemplo n.º 1
0
        public void ReturnsFalseWhenErrorOccured()
        {
            var cleaner = new CleanPackageBuilder(Path.Combine(TestContext.CurrentContext.WorkDirectory, Randomizer.CreateRandomizer().GetString(10)))
                          .Target("bin", "debug")
                          .Build();

            Assert.IsFalse(cleaner.Execute());
        }
Ejemplo n.º 2
0
        public void EnsureCleanerCleansAllTarget()
        {
            var root    = CreateDirectoryStructure();
            var cleaner = new CleanPackageBuilder(root)
                          .Target("bin", "obj")
                          .Build();

            Assert.IsTrue(cleaner.Execute());
            Assert.AreEqual(0, Directory.GetDirectories(root, "bin", SearchOption.AllDirectories).ToArray().Length);
            Assert.AreEqual(0, Directory.GetDirectories(root, "obj", SearchOption.AllDirectories).ToArray().Length);
            Directory.Delete(root, true);
        }
Ejemplo n.º 3
0
        public void EnsureCleanerLocalNameExclude()
        {
            var root    = CreateDirectoryStructure();
            var cleaner = new CleanPackageBuilder(root)
                          .Target("bin", "obj")
                          .Exclude(Path.GetFileName(root))
                          .Build();

            Assert.IsTrue(cleaner.Execute());
            Assert.Greater(Directory.GetDirectories(root, "bin", SearchOption.AllDirectories).ToArray().Length, 0);
            Assert.Greater(Directory.GetDirectories(root, "obj", SearchOption.AllDirectories).ToArray().Length, 0);
            Directory.Delete(root, true);
        }