Skip to content

Commit 9c74cd7

Browse files
stazzasbjornu
authored andcommitted
Making GitVersionTask.Tests compilable again.
1 parent 7a077a5 commit 9c74cd7

File tree

2 files changed

+66
-66
lines changed

2 files changed

+66
-66
lines changed

src/GitVersionTask.Tests/GetVersionTaskTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public class GetVersionTaskTests : TestBase
1010
[Test]
1111
public void OutputsShouldMatchVariableProvider()
1212
{
13-
var taskProperties = typeof( GetVersion.Output )
13+
var taskProperties = typeof(GetVersion.Output)
1414
.GetProperties()
15-
.Select( p => p.Name );
15+
.Select(p => p.Name);
1616

1717
var variablesProperties = VersionVariables.AvailableVariables;
1818

19-
taskProperties.ShouldBe( variablesProperties, ignoreOrder: true );
19+
taskProperties.ShouldBe(variablesProperties, ignoreOrder: true);
2020
}
2121
}

src/GitVersionTask.Tests/InvalidFileCheckerTests.cs

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -12,207 +12,207 @@ public class InvalidFileCheckerTests : TestBase
1212
[SetUp]
1313
public void CreateTemporaryProject()
1414
{
15-
projectDirectory = Path.Combine( Path.GetTempPath(), Guid.NewGuid().ToString() );
16-
projectFile = Path.Combine( projectDirectory, "Fake.csproj" );
15+
projectDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
16+
projectFile = Path.Combine(projectDirectory, "Fake.csproj");
1717

18-
Directory.CreateDirectory( projectDirectory );
18+
Directory.CreateDirectory(projectDirectory);
1919

20-
File.Create( projectFile ).Close();
20+
File.Create(projectFile).Close();
2121
}
2222

2323
[TearDown]
2424
public void Cleanup()
2525
{
26-
Directory.Delete( projectDirectory, true );
26+
Directory.Delete(projectDirectory, true);
2727
}
2828

2929
[Test]
3030
public void VerifyIgnoreNonAssemblyInfoFile()
3131
{
32-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "SomeOtherFile.cs" ) ) )
32+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "SomeOtherFile.cs")))
3333
{
34-
writer.Write( @"
34+
writer.Write(@"
3535
using System;
3636
using System.Reflection;
3737
3838
[assembly: AssemblyVersion(""1.0.0.0"")]
39-
" );
39+
");
4040
}
4141

42-
InvalidFileChecker.CheckForInvalidFiles( new[] { "SomeOtherFile.cs" }, projectFile );
42+
InvalidFileChecker.CheckForInvalidFiles(new[] { "SomeOtherFile.cs" }, projectFile);
4343
}
4444

4545
[Test]
46-
public void VerifyAttributeFoundCSharp( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System.Reflection.AssemblyVersion" )]string attribute )
46+
public void VerifyAttributeFoundCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System.Reflection.AssemblyVersion")]string attribute)
4747
{
48-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.cs" ) ) )
48+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.cs")))
4949
{
50-
writer.Write( @"
50+
writer.Write(@"
5151
using System;
5252
using System.Reflection;
5353
5454
[assembly:{0}(""1.0.0.0"")]
55-
", attribute );
55+
", attribute);
5656
}
5757

58-
var ex = Assert.Throws<WarningException>( () => InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.cs" }, projectFile ), attribute );
59-
Assert.That( ex.Message, Is.EqualTo( "File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.cs" ) );
58+
var ex = Assert.Throws<WarningException>(() => InvalidFileChecker.CheckForInvalidFiles(new [] { "AssemblyInfo.cs" }, projectFile), attribute);
59+
Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.cs"));
6060
}
6161

6262
[Test]
63-
public void VerifyUnformattedAttributeFoundCSharp( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System . Reflection . AssemblyVersion" )]string attribute )
63+
public void VerifyUnformattedAttributeFoundCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System . Reflection . AssemblyVersion")]string attribute)
6464
{
65-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.cs" ) ) )
65+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.cs")))
6666
{
67-
writer.Write( @"
67+
writer.Write(@"
6868
using System;
6969
using System.Reflection;
7070
7171
[ assembly :
7272
{0} ( ""1.0.0.0"")]
73-
", attribute );
73+
", attribute);
7474
}
7575

76-
var ex = Assert.Throws<WarningException>( () => InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.cs" }, projectFile ), attribute );
77-
Assert.That( ex.Message, Is.EqualTo( "File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.cs" ) );
76+
var ex = Assert.Throws<WarningException>(() => InvalidFileChecker.CheckForInvalidFiles(new [] { "AssemblyInfo.cs" }, projectFile), attribute);
77+
Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.cs"));
7878
}
7979

8080
[Test]
81-
public void VerifyCommentWorksCSharp( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion" )]string attribute )
81+
public void VerifyCommentWorksCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")]string attribute)
8282
{
83-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.cs" ) ) )
83+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.cs")))
8484
{
85-
writer.Write( @"
85+
writer.Write(@"
8686
using System;
8787
using System.Reflection;
8888
8989
//[assembly: {0}(""1.0.0.0"")]
90-
", attribute );
90+
", attribute);
9191
}
9292

93-
InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.cs" }, projectFile );
93+
InvalidFileChecker.CheckForInvalidFiles(new[] { "AssemblyInfo.cs" }, projectFile);
9494
}
9595

9696
[Test]
97-
public void VerifyStringWorksCSharp( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion" )]string attribute )
97+
public void VerifyStringWorksCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")]string attribute)
9898
{
99-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.cs" ) ) )
99+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.cs")))
100100
{
101-
writer.Write( @"
101+
writer.Write(@"
102102
using System;
103103
using System.Reflection;
104104
105105
public class Temp
106106
{{
107107
static const string Foo = ""[assembly: {0}(""""1.0.0.0"""")]"";
108108
}}
109-
", attribute );
109+
", attribute);
110110
}
111111

112-
InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.cs" }, projectFile );
112+
InvalidFileChecker.CheckForInvalidFiles(new[] { "AssemblyInfo.cs" }, projectFile);
113113
}
114114

115115
[Test]
116-
public void VerifyIdentifierWorksCSharp( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion" )]string attribute )
116+
public void VerifyIdentifierWorksCSharp([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")]string attribute)
117117
{
118-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.cs" ) ) )
118+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.cs")))
119119
{
120-
writer.Write( @"
120+
writer.Write(@"
121121
using System;
122122
using System.Reflection;
123123
124124
public class {0}
125125
{{
126126
}}
127-
", attribute );
127+
", attribute);
128128
}
129129

130-
InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.cs" }, projectFile );
130+
InvalidFileChecker.CheckForInvalidFiles(new[] { "AssemblyInfo.cs" }, projectFile);
131131
}
132132

133133
[Test]
134-
public void VerifyAttributeFoundVisualBasic( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System.Reflection.AssemblyVersion" )]string attribute )
134+
public void VerifyAttributeFoundVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System.Reflection.AssemblyVersion")]string attribute)
135135
{
136-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.vb" ) ) )
136+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.vb")))
137137
{
138-
writer.Write( @"
138+
writer.Write(@"
139139
Imports System
140140
Imports System.Reflection
141141
142142
<Assembly:{0}(""1.0.0.0"")>
143-
", attribute );
143+
", attribute);
144144
}
145145

146-
var ex = Assert.Throws<WarningException>( () => InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.vb" }, projectFile ), attribute );
147-
Assert.That( ex.Message, Is.EqualTo( "File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.vb" ) );
146+
var ex = Assert.Throws<WarningException>(() => InvalidFileChecker.CheckForInvalidFiles(new[] { "AssemblyInfo.vb" }, projectFile), attribute);
147+
Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.vb"));
148148
}
149149

150150
[Test]
151-
public void VerifyUnformattedAttributeFoundVisualBasic( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System . Reflection . AssemblyVersion" )]string attribute )
151+
public void VerifyUnformattedAttributeFoundVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion", "System . Reflection . AssemblyVersion")]string attribute)
152152
{
153-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.vb" ) ) )
153+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.vb")))
154154
{
155-
writer.Write( @"
155+
writer.Write(@"
156156
Imports System
157157
Imports System.Reflection
158158
159159
< Assembly :
160160
{0} ( ""1.0.0.0"")>
161-
", attribute );
161+
", attribute);
162162
}
163163

164-
var ex = Assert.Throws<WarningException>( () => InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.vb" }, projectFile ), attribute );
165-
Assert.That( ex.Message, Is.EqualTo( "File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.vb" ) );
164+
var ex = Assert.Throws<WarningException>(() => InvalidFileChecker.CheckForInvalidFiles(new[] { "AssemblyInfo.vb" }, projectFile), attribute);
165+
Assert.That(ex.Message, Is.EqualTo("File contains assembly version attributes which conflict with the attributes generated by GitVersion AssemblyInfo.vb"));
166166
}
167167

168168
[Test]
169-
public void VerifyCommentWorksVisualBasic( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion" )]string attribute )
169+
public void VerifyCommentWorksVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")]string attribute)
170170
{
171-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.vb" ) ) )
171+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.vb")))
172172
{
173-
writer.Write( @"
173+
writer.Write(@"
174174
Imports System
175175
Imports System.Reflection
176176
177177
'<Assembly: {0}(""1.0.0.0"")>
178-
", attribute );
178+
", attribute);
179179
}
180180

181-
InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.vb" }, projectFile );
181+
InvalidFileChecker.CheckForInvalidFiles(new[] { "AssemblyInfo.vb" }, projectFile);
182182
}
183183

184184
[Test]
185-
public void VerifyStringWorksVisualBasic( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion" )]string attribute )
185+
public void VerifyStringWorksVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")]string attribute)
186186
{
187-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.vb" ) ) )
187+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.vb")))
188188
{
189-
writer.Write( @"
189+
writer.Write(@"
190190
Imports System
191191
Imports System.Reflection
192192
193193
Public Class Temp
194194
static const string Foo = ""<Assembly: {0}(""""1.0.0.0"""")>"";
195195
End Class
196-
", attribute );
196+
", attribute);
197197
}
198198

199-
InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.vb" }, projectFile );
199+
InvalidFileChecker.CheckForInvalidFiles(new[] { "AssemblyInfo.vb" }, projectFile);
200200
}
201201

202202
[Test]
203-
public void VerifyIdentifierWorksVisualBasic( [Values( "AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion" )]string attribute )
203+
public void VerifyIdentifierWorksVisualBasic([Values("AssemblyVersion", "AssemblyFileVersion", "AssemblyInformationalVersion")]string attribute)
204204
{
205-
using ( var writer = File.CreateText( Path.Combine( projectDirectory, "AssemblyInfo.vb" ) ) )
205+
using (var writer = File.CreateText(Path.Combine(projectDirectory, "AssemblyInfo.vb")))
206206
{
207-
writer.Write( @"
207+
writer.Write(@"
208208
Imports System
209209
Imports System.Reflection
210210
211211
Public Class {0}
212212
End Class
213-
", attribute );
213+
", attribute);
214214
}
215215

216-
InvalidFileChecker.CheckForInvalidFiles( new[] { "AssemblyInfo.vb" }, projectFile );
216+
InvalidFileChecker.CheckForInvalidFiles(new[] { "AssemblyInfo.vb" }, projectFile);
217217
}
218218
}

0 commit comments

Comments
 (0)