public void DirectoryDelete_DoesNotExist_ThrowsException()
        {
            var mockReader = Helper.GetMockReader(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 1);
            var delDir     = new DirectoryDelete();

            delDir.ReadXml(mockReader.Object);

            var bRet = delDir.Run();
        }
Beispiel #2
0
        public void DirectoryDelete_DoesNotExist_Succeeds()
        {
            var mockReader = Helper.GetMockReader(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 1);
            var delDir     = new DirectoryDelete();

            delDir.ReadXml(mockReader.Object);

            Assert.True(delDir.Run());
        }
Beispiel #3
0
        public void DirectoryDelete_Exists_Succeeds()
        {
            var cwd         = Environment.CurrentDirectory;
            var tempDirName = Guid.NewGuid().ToString();
            var tempDirPath = Path.Combine(cwd, tempDirName);
            var mockReader  = Helper.GetMockReader(tempDirPath, Guid.NewGuid().ToString(), 1);
            var delDir      = new DirectoryDelete();

            delDir.ReadXml(mockReader.Object);
            Directory.CreateDirectory(tempDirPath);

            Assert.True(delDir.Run());
            Assert.True(!Directory.Exists(tempDirPath));
        }