forked from jagregory/docu
/
UntransformableResourceManagerTests.cs
102 lines (80 loc) · 2.52 KB
/
UntransformableResourceManagerTests.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
using System.IO;
using NUnit.Framework;
namespace Docu.Tests.Output
{
[TestFixture]
public class UntransformableResourceManagerTests : UntransformableResourceManagerTestsBase
{
[Test]
public void should_move_htm_files()
{
move_files();
file_should_exist(output_folder, "a_html_page.htm");
}
[Test]
public void should_move_css_files()
{
move_files();
file_should_exist(output_folder, "a_css_file.css");
}
[Test]
public void should_move_nonempty_dirs()
{
move_files();
directory_should_exist(output_folder, "sub_directory");
}
[Test]
public void should_move_untransformed_files_in_nonempty_dirs()
{
move_files();
file_should_exist(output_folder, "sub_directory", "another_html_page.htm");
}
[Test]
public void shouldnt_move_spark_files()
{
move_files();
file_shouldnt_exist(output_folder, "a_spark_file.spark");
}
[Test]
public void shouldnt_move_spark_files_in_sub_dirs()
{
move_files();
file_shouldnt_exist(output_folder, "sub_directory", "another_spark_file.spark");
}
[Test]
public void shouldnt_move_empty_dirs()
{
move_files();
directory_shouldnt_exist(output_folder, "empty_sub_directory");
}
[Test]
public void should_overwrite_files()
{
// create css file
File.WriteAllText(Path.Combine(output_folder, "a_css_file.css"), "");
move_files();
file_should_exist(output_folder, "a_css_file.css");
}
[Test]
public void should_overwrite_directories()
{
// create css file
Directory.CreateDirectory(Path.Combine(output_folder, "sub_directory"));
move_files();
directory_should_exist(output_folder, "sub_directory");
}
[Test]
public void shouldnt_move_hidden_files()
{
move_files();
file_shouldnt_exist(output_folder, "hiddenfile.htm");
}
[Test]
public void shouldnt_move_files_under_hidden_folders()
{
move_files();
directory_shouldnt_exist(output_folder, "hidden_directory");
file_shouldnt_exist(output_folder, "hidden_directory", "file_in_hidden_dir.htm");
}
}
}