Skip to content

Commit 62d84f5

Browse files
committed
Merge branch 'dependabot/nuget/NUnit-4.3.2'
2 parents f693099 + 9731aad commit 62d84f5

File tree

5 files changed

+102
-65
lines changed

5 files changed

+102
-65
lines changed

CodeArtEng.Controls.UnitTests/CodeArtEng.Controls.UnitTests.csproj

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="../packages/NUnit.4.3.2/build/NUnit.props" Condition="Exists('../packages/NUnit.4.3.2/build/NUnit.props')" />
34
<Import Project="..\packages\NUnit.3.13.3\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" />
45
<Import Project="..\packages\NUnit3TestAdapter.4.5.0\build\net462\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.4.5.0\build\net462\NUnit3TestAdapter.props')" />
56
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@@ -37,12 +38,41 @@
3738
<CodeAnalysisRuleSet />
3839
</PropertyGroup>
3940
<ItemGroup>
40-
<Reference Include="nunit.framework, Version=3.13.3.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
41-
<HintPath>..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll</HintPath>
41+
<Reference Include="nunit.framework, Version=4.3.2.0, Culture=neutral, PublicKeyToken=2638cd05610744eb">
42+
<HintPath>..\packages\NUnit.4.3.2\lib\net462\nunit.framework.dll</HintPath>
43+
<Private>True</Private>
44+
</Reference>
45+
<Reference Include="nunit.framework.legacy, Version=4.3.2.0, Culture=neutral, PublicKeyToken=2638cd05610744eb">
46+
<HintPath>..\packages\NUnit.4.3.2\lib\net462\nunit.framework.legacy.dll</HintPath>
47+
<Private>True</Private>
4248
</Reference>
4349
<Reference Include="System" />
50+
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
51+
<HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
52+
<Private>True</Private>
53+
</Reference>
4454
<Reference Include="System.Core" />
4555
<Reference Include="System.Drawing" />
56+
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
57+
<HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
58+
<Private>True</Private>
59+
</Reference>
60+
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
61+
<HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
62+
<Private>True</Private>
63+
</Reference>
64+
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
65+
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
66+
<Private>True</Private>
67+
</Reference>
68+
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
69+
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
70+
<Private>True</Private>
71+
</Reference>
72+
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
73+
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
74+
<Private>True</Private>
75+
</Reference>
4676
<Reference Include="System.Xml.Linq" />
4777
<Reference Include="System.Data.DataSetExtensions" />
4878
<Reference Include="Microsoft.CSharp" />
@@ -72,6 +102,7 @@
72102
</PropertyGroup>
73103
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.4.5.0\build\net462\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.4.5.0\build\net462\NUnit3TestAdapter.props'))" />
74104
<Error Condition="!Exists('..\packages\NUnit.3.13.3\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.3\build\NUnit.props'))" />
105+
<Error Condition="!Exists('../packages/NUnit.4.3.2/build/NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '../packages/NUnit.4.3.2/build/NUnit.props'))" />
75106
</Target>
76107
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
77108
Other similar extension points exist, see Microsoft.Common.targets.

CodeArtEng.Controls.UnitTests/CommandLineHelperTests.cs

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using NUnit.Framework;
1+
using NUnit.Framework;
22
using System;
33

44
namespace CodeArtEng.Controls.UnitTests
@@ -22,13 +22,13 @@ public void Setup()
2222
[Test]
2323
public void GetArgumentsName()
2424
{
25-
Assert.AreEqual(new string[] { "Source" }, cmdLine.GetArgumentsName());
25+
Assert.That(cmdLine.GetArgumentsName(), Is.EqualTo(new string[] { "Source" }));
2626
}
2727

2828
[Test]
2929
public void GetSwitchesName()
3030
{
31-
Assert.AreEqual(new string[] { "/AD", "/MIN", "/DELAY" }, cmdLine.GetSwitchesName());
31+
Assert.That(cmdLine.GetSwitchesName(), Is.EqualTo(new string[] { "/AD", "/MIN", "/DELAY" }));
3232
}
3333

3434

@@ -37,15 +37,15 @@ public void SetDescription_Constructor()
3737
{
3838
string desc = DateTime.Now.ToString();
3939
CommandLineHelper cmdLine2 = new CommandLineHelper(desc);
40-
Assert.AreEqual(desc, cmdLine2.Description);
40+
Assert.That(cmdLine2.Description, Is.EqualTo(desc));
4141
}
4242

4343
[Test]
4444
public void SetDescription_Property()
4545
{
4646
string desc = DateTime.Now.ToString();
4747
cmdLine.Description = desc;
48-
Assert.AreEqual(desc, cmdLine.Description);
48+
Assert.That(cmdLine.Description, Is.EqualTo(desc));
4949
}
5050

5151
[Test]
@@ -75,148 +75,148 @@ public void AddSwitches_Duplicate_Exception()
7575
[Test]
7676
public void IsSwitchSet_InvalidSwitch()
7777
{
78-
Assert.AreEqual(false, cmdLine.IsSwitchSet("/NotExist"));
78+
Assert.That(cmdLine.IsSwitchSet("/NotExist"), Is.EqualTo(false));
7979
}
8080

8181
[Test]
8282
public void GetArgumentValue_Invalid()
8383
{
8484
Assert.Throws<ArgumentNullException>(() =>
85-
{
86-
cmdLine.GetArgumentValue("Unknown");
87-
});
85+
{
86+
cmdLine.GetArgumentValue("Unknown");
87+
});
8888
}
8989

9090
[Test]
9191
public void SetArgument()
9292
{
9393
cmdLine.SetArgument("Source", "C:\\Temp");
94-
Assert.AreEqual("C:\\Temp", cmdLine.GetArgumentValue("Source"));
94+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.EqualTo("C:\\Temp"));
9595
}
9696

9797
[Test]
9898
public void SetSwitch()
9999
{
100100
cmdLine.SetSwitch("/MIN");
101-
Assert.IsTrue(cmdLine.IsSwitchSet("/MIN"));
101+
Assert.That(cmdLine.IsSwitchSet("/MIN"), Is.True);
102102
}
103103

104104
[Test]
105105
public void SetSwitchValue()
106106
{
107107
cmdLine.SetSwitch("/DELAY", "200");
108-
Assert.IsTrue(cmdLine.IsSwitchSet("/DeLaY"));
109-
Assert.AreEqual("200", cmdLine.GetSwitchValue("/Delay"));
108+
Assert.That(cmdLine.IsSwitchSet("/DeLaY"), Is.True);
109+
Assert.That(cmdLine.GetSwitchValue("/Delay"), Is.EqualTo("200"));
110110
}
111111

112112
[Test]
113113
public void SetArgument_InvalidArgument()
114114
{
115115
Assert.Throws<ArgumentException>(() =>
116-
{
117-
cmdLine.SetArgument("DUMMY", "TEST");
118-
});
116+
{
117+
cmdLine.SetArgument("DUMMY", "TEST");
118+
});
119119
}
120120

121121
[Test]
122122
public void SetSwitch_InvalidSwitch()
123123
{
124124
Assert.Throws<ArgumentException>(() =>
125-
{
126-
cmdLine.SetSwitch("/NOTEXIST");
127-
});
125+
{
126+
cmdLine.SetSwitch("/NOTEXIST");
127+
});
128128
}
129129

130130

131131
[Test]
132132
public void ParseCommandLine()
133133
{
134134
bool status = cmdLine.ParseCommandLine(("SourcePath /AD").Split(' '));
135-
Assert.AreEqual("SourcePath", cmdLine.GetArgumentValue("Source"));
136-
Assert.IsTrue(cmdLine.IsSwitchSet("/AD"));
137-
Assert.IsFalse(cmdLine.IsSwitchSet("/min"));
138-
Assert.IsFalse(cmdLine.IsSwitchSet("/Delay"));
139-
Assert.AreEqual("NoDelay", cmdLine.GetSwitchValue("/delay", "NoDelay"));
140-
Assert.IsTrue(status);
135+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.EqualTo("SourcePath"));
136+
Assert.That(cmdLine.IsSwitchSet("/AD"), Is.True);
137+
Assert.That(cmdLine.IsSwitchSet("/min"), Is.False);
138+
Assert.That(cmdLine.IsSwitchSet("/Delay"), Is.False);
139+
Assert.That(cmdLine.GetSwitchValue("/delay", "NoDelay"), Is.EqualTo("NoDelay"));
140+
Assert.That(status, Is.True);
141141
}
142142

143143
[Test]
144144
public void ParseCommandLine_SwitchNotSet()
145145
{
146146
cmdLine.ParseCommandLine(("SourcePath").Split(' '));
147-
Assert.AreEqual("SourcePath", cmdLine.GetArgumentValue("Source"));
148-
Assert.IsFalse(cmdLine.IsSwitchSet("/AD"));
149-
Assert.IsFalse(cmdLine.IsSwitchSet("/MIN"));
147+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.EqualTo("SourcePath"));
148+
Assert.That(cmdLine.IsSwitchSet("/AD"), Is.False);
149+
Assert.That(cmdLine.IsSwitchSet("/MIN"), Is.False);
150150
}
151151

152152
[Test]
153153
public void ParseCommandLine_SetInvalidSwitch()
154154
{
155155
cmdLine.ParseCommandLine(("SourcePath /ADS").Split(' '));
156-
Assert.AreEqual("SourcePath", cmdLine.GetArgumentValue("Source"));
157-
Assert.IsFalse(cmdLine.IsSwitchSet("/AD"));
158-
Assert.IsFalse(cmdLine.IsSwitchSet("/MIN"));
156+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.EqualTo("SourcePath"));
157+
Assert.That(cmdLine.IsSwitchSet("/AD"), Is.False);
158+
Assert.That(cmdLine.IsSwitchSet("/MIN"), Is.False);
159159
}
160160

161161
[Test]
162162
public void ParseCommandLine_MissingMandatoryArg_Exception()
163163
{
164164
Assert.Throws<Exception>(() =>
165-
{
166-
cmdLine.ParseCommandLine(("/AD /MIN").Split(' '));
167-
});
165+
{
166+
cmdLine.ParseCommandLine(("/AD /MIN").Split(' '));
167+
});
168168
}
169169

170170
[Test]
171171
public void ParseCommandLine_SetSwitchWithValue()
172172
{
173173
cmdLine.ParseCommandLine(("SourcePath /delay:100").Split(' '));
174-
Assert.AreEqual("SourcePath", cmdLine.GetArgumentValue("Source"));
175-
Assert.AreEqual("100", cmdLine.GetSwitchValue("/Delay", "-1"));
174+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.EqualTo("SourcePath"));
175+
Assert.That(cmdLine.GetSwitchValue("/Delay", "-1"), Is.EqualTo("100"));
176176
}
177177

178178
[Test]
179179
public void ParseCommandLine_SetSwitchWithoutValue()
180180
{
181181
cmdLine.ParseCommandLine(("SourcePath /delay").Split(' '));
182-
Assert.AreEqual("SourcePath", cmdLine.GetArgumentValue("Source"));
183-
Assert.AreEqual("-1", cmdLine.GetSwitchValue("/Delay", "-1"));
182+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.EqualTo("SourcePath"));
183+
Assert.That(cmdLine.GetSwitchValue("/Delay", "-1"), Is.EqualTo("-1"));
184184
}
185185

186186
[Test]
187187
public void ParseCommandLine_SetValueToBooleanSwitch()
188188
{
189189
cmdLine.ParseCommandLine(("SourcePath /min:100").Split(' '));
190-
Assert.AreEqual("SourcePath", cmdLine.GetArgumentValue("Source"));
191-
Assert.AreEqual("NotValid", cmdLine.GetSwitchValue("/min", "NotValid"));
190+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.EqualTo("SourcePath"));
191+
Assert.That(cmdLine.GetSwitchValue("/min", "NotValid"), Is.EqualTo("NotValid"));
192192
}
193193

194194
[Test]
195195
public void ParseCommandLine_NoMandatoryArgument()
196196
{
197197
cmdLine = new CommandLineHelper("Testing");
198-
Assert.IsTrue(cmdLine.ParseCommandLine(("/A /BC").Split(' ')));
198+
Assert.That(cmdLine.ParseCommandLine(("/A /BC").Split(' ')), Is.True);
199199
}
200200

201201
[Test]
202202
public void ParseCommandLine_TooMuchArguments()
203203
{
204204
cmdLine.ParseCommandLine(("SourcePath DestPath /X /delay:5555 /XY /TEST").Split(' '));
205-
Assert.AreEqual("SourcePath", cmdLine.GetArgumentValue("Source"));
206-
Assert.AreEqual("5555", cmdLine.GetSwitchValue("/Delay", "-1"));
205+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.EqualTo("SourcePath"));
206+
Assert.That(cmdLine.GetSwitchValue("/Delay", "-1"), Is.EqualTo("5555"));
207207
}
208208

209209
[Test]
210210
public void ParseCommandLine_EmptyCommand()
211211
{
212-
Assert.IsFalse(cmdLine.ParseCommandLine(new string[] { }));
212+
Assert.That(cmdLine.ParseCommandLine(new string[] { }), Is.False);
213213
}
214214

215215
[Test]
216216
public void ParseCommandLine_EnvArgs()
217217
{
218218
//NUnit Command Line is not empty by default
219-
Assert.IsTrue(cmdLine.ParseCommandLine());
219+
Assert.That(cmdLine.ParseCommandLine(), Is.True);
220220
}
221221

222222
[Test]
@@ -225,13 +225,13 @@ public void Reset()
225225
cmdLine.SetArgument("Source", "Test Value");
226226
cmdLine.SetSwitch("/MIN");
227227

228-
Assert.AreEqual("Test Value", cmdLine.GetArgumentValue("Source"));
229-
Assert.IsTrue(cmdLine.IsSwitchSet("/MIN"));
228+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.EqualTo("Test Value"));
229+
Assert.That(cmdLine.IsSwitchSet("/MIN"), Is.True);
230230

231231
cmdLine.Reset();
232232

233-
Assert.IsEmpty(cmdLine.GetArgumentValue("Source"));
234-
Assert.IsFalse(cmdLine.IsSwitchSet("/MIN"));
233+
Assert.That(cmdLine.GetArgumentValue("Source"), Is.Empty);
234+
Assert.That(cmdLine.IsSwitchSet("/MIN"), Is.False);
235235
}
236236

237237
[Test]
@@ -241,7 +241,7 @@ public void SetSwitchValueWithColumn()
241241
cmd.AddSwitch("/log", "Log File.", "logFile");
242242
cmd.SetSwitch("/log", "C:\\Temp\\Output.txt");
243243

244-
Assert.AreEqual("C:\\Temp\\Output.txt", cmd.GetSwitchValue("/log"));
244+
Assert.That(cmd.GetSwitchValue("/log"), Is.EqualTo("C:\\Temp\\Output.txt"));
245245
}
246246

247247
[Test]
@@ -250,7 +250,7 @@ public void ParseCommandLineFileName()
250250
CommandLineHelper cmd = new CommandLineHelper("File");
251251
cmd.AddSwitch("/log", "Log File.", "logFile");
252252
cmd.ParseCommandLine(("/log:C:\\Temp\\Output.txt").Split(' '));
253-
Assert.AreEqual("C:\\Temp\\Output.txt", cmd.GetSwitchValue("/log"));
253+
Assert.That(cmd.GetSwitchValue("/log"), Is.EqualTo("C:\\Temp\\Output.txt"));
254254
}
255255

256256
}

CodeArtEng.Controls.UnitTests/LabeledTextBoxTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using NUnit.Framework;
1+
using NUnit.Framework;
22

33
namespace CodeArtEng.Controls.UnitTests
44
{
@@ -13,7 +13,7 @@ public void ComboBoxSelectedText()
1313
lb.DropDownListItems = new string[] { "Item1", "Item2", "Item3" };
1414
lb.DropDownListSelectedIndex = 1;
1515

16-
Assert.AreEqual("Item2", lb.Text);
16+
Assert.That(lb.Text,Is.EqualTo("Item2"));
1717
}
1818

1919
[Test]
@@ -22,9 +22,9 @@ public void ComboBoxItems()
2222
LabeledTextBox lb = new LabeledTextBox();
2323
lb.IsDropDownList = true;
2424
lb.DropDownListItems = new string[] { "Item1", "Item2", "Item3" };
25-
Assert.AreEqual(lb.DropDownListItems.Length, 3);
25+
Assert.That(3,Is.EqualTo(lb.DropDownListItems.Length));
2626
lb.DropDownListItems = new string[] { "Test" };
27-
Assert.AreEqual(lb.DropDownListItems.Length, 1);
27+
Assert.That(1,Is.EqualTo(lb.DropDownListItems.Length));
2828
}
2929
}
3030
}

0 commit comments

Comments
 (0)