1
1
using System ;
2
2
using System . IO ;
3
3
using GitVersion ;
4
- using GitVersionTask . Tests . Mocks ;
5
- using Microsoft . Build . Framework ;
6
4
using NUnit . Framework ;
7
5
8
6
[ TestFixture ]
@@ -41,7 +39,7 @@ public void VerifyIgnoreNonAssemblyInfoFile()
41
39
" ) ;
42
40
}
43
41
44
- InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "SomeOtherFile.cs" } } , projectFile ) ;
42
+ InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "SomeOtherFile.cs" } , projectFile ) ;
45
43
}
46
44
47
45
[ Test ]
@@ -57,7 +55,7 @@ public void VerifyAttributeFoundCSharp([Values("AssemblyVersion", "AssemblyFileV
57
55
" , attribute ) ;
58
56
}
59
57
60
- var ex = Assert . Throws < WarningException > ( ( ) => InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } } , projectFile ) , attribute ) ;
58
+ var ex = Assert . Throws < WarningException > ( ( ) => InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.cs" } , projectFile ) , attribute ) ;
61
59
Assert . That ( ex . Message , Is . EqualTo ( "File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.cs" ) ) ;
62
60
}
63
61
@@ -75,7 +73,7 @@ public void VerifyUnformattedAttributeFoundCSharp([Values("AssemblyVersion", "As
75
73
" , attribute ) ;
76
74
}
77
75
78
- var ex = Assert . Throws < WarningException > ( ( ) => InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } } , projectFile ) , attribute ) ;
76
+ var ex = Assert . Throws < WarningException > ( ( ) => InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.cs" } , projectFile ) , attribute ) ;
79
77
Assert . That ( ex . Message , Is . EqualTo ( "File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.cs" ) ) ;
80
78
}
81
79
@@ -92,7 +90,7 @@ public void VerifyCommentWorksCSharp([Values("AssemblyVersion", "AssemblyFileVer
92
90
" , attribute ) ;
93
91
}
94
92
95
- InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } } , projectFile ) ;
93
+ InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.cs" } , projectFile ) ;
96
94
}
97
95
98
96
[ Test ]
@@ -111,7 +109,7 @@ public class Temp
111
109
" , attribute ) ;
112
110
}
113
111
114
- InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } } , projectFile ) ;
112
+ InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.cs" } , projectFile ) ;
115
113
}
116
114
117
115
[ Test ]
@@ -129,7 +127,7 @@ public class {0}
129
127
" , attribute ) ;
130
128
}
131
129
132
- InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.cs" } } , projectFile ) ;
130
+ InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.cs" } , projectFile ) ;
133
131
}
134
132
135
133
[ Test ]
@@ -145,7 +143,7 @@ Imports System.Reflection
145
143
" , attribute ) ;
146
144
}
147
145
148
- var ex = Assert . Throws < WarningException > ( ( ) => InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } } , projectFile ) , attribute ) ;
146
+ var ex = Assert . Throws < WarningException > ( ( ) => InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.vb" } , projectFile ) , attribute ) ;
149
147
Assert . That ( ex . Message , Is . EqualTo ( "File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.vb" ) ) ;
150
148
}
151
149
@@ -163,7 +161,7 @@ Imports System.Reflection
163
161
" , attribute ) ;
164
162
}
165
163
166
- var ex = Assert . Throws < WarningException > ( ( ) => InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } } , projectFile ) , attribute ) ;
164
+ var ex = Assert . Throws < WarningException > ( ( ) => InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.vb" } , projectFile ) , attribute ) ;
167
165
Assert . That ( ex . Message , Is . EqualTo ( "File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.vb" ) ) ;
168
166
}
169
167
@@ -180,7 +178,7 @@ Imports System.Reflection
180
178
" , attribute ) ;
181
179
}
182
180
183
- InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } } , projectFile ) ;
181
+ InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.vb" } , projectFile ) ;
184
182
}
185
183
186
184
[ Test ]
@@ -198,7 +196,7 @@ End Class
198
196
" , attribute ) ;
199
197
}
200
198
201
- InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } } , projectFile ) ;
199
+ InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.vb" } , projectFile ) ;
202
200
}
203
201
204
202
[ Test ]
@@ -215,6 +213,6 @@ End Class
215
213
" , attribute ) ;
216
214
}
217
215
218
- InvalidFileChecker . CheckForInvalidFiles ( new ITaskItem [ ] { new MockTaskItem { ItemSpec = "AssemblyInfo.vb" } } , projectFile ) ;
216
+ InvalidFileChecker . CheckForInvalidFiles ( new [ ] { "AssemblyInfo.vb" } , projectFile ) ;
219
217
}
220
218
}
0 commit comments