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