forked from baronfel/FAKE
/
CleanDirectorySpecs.cs
30 lines (23 loc) · 1.12 KB
/
CleanDirectorySpecs.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.IO;
using Machine.Specifications;
namespace Test.FAKECore.FileHandling
{
public class when_cleaning_empty_directory_after_creating_test_structure : BaseFunctions
{
Establish context = CreateTestDirStructure;
Because of = () => CleanDir(TestData.TestDir);
It should_cleaned_all_dirs = () => AllDirectories().ShouldBeEmpty();
It should_cleaned_all_files = () => AllFiles().ShouldBeEmpty();
It should_still_exist = () => new DirectoryInfo(TestData.TestDir).Exists.ShouldBeTrue();
}
public class when_cleaning_directory_after_creating_test_structure : BaseFunctions
{
Establish context = CreateTestFileStructure;
Because of = () => CleanDir(TestData.TestDir);
It should_be_writeable =
() => new DirectoryInfo(TestData.TestDir).Attributes.ShouldEqual(FileAttributes.Directory);
It should_cleaned_all_dirs = () => AllDirectories().ShouldBeEmpty();
It should_cleaned_all_files = () => AllFiles().ShouldBeEmpty();
It should_still_exist = () => new DirectoryInfo(TestData.TestDir).Exists.ShouldBeTrue();
}
}