Skip to content

Commit 07e1d8a

Browse files
authored
Update unit tests project. (#223)
- Set .net core xunit test - remove tests for more functionaly from master - fix test for subredditimage
1 parent 2e1fd10 commit 07e1d8a

File tree

12 files changed

+97
-777
lines changed

12 files changed

+97
-777
lines changed

RedditSharp.sln

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27130.2010
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29728.190
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{46584E90-4894-4EB7-A0B9-FDAF29B4AF8B}"
77
ProjectSection(SolutionItems) = preProject
@@ -13,6 +13,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RedditSharp", "RedditSharp\
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RedditSharpTests", "RedditSharpTests\RedditSharpTests.csproj", "{BE04B672-0F15-4507-8029-6A861061DED5}"
1515
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTesting", "UnitTesting\UnitTesting.csproj", "{D164656E-D0E6-41A0-ADEA-37C55E34531B}"
17+
EndProject
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTesting_old", "UnitTesting_old\UnitTesting_old.csproj", "{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}"
19+
EndProject
1620
Global
1721
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1822
Debug|Any CPU = Debug|Any CPU
@@ -47,6 +51,30 @@ Global
4751
{BE04B672-0F15-4507-8029-6A861061DED5}.Release|Mixed Platforms.Build.0 = Release|Any CPU
4852
{BE04B672-0F15-4507-8029-6A861061DED5}.Release|x86.ActiveCfg = Release|Any CPU
4953
{BE04B672-0F15-4507-8029-6A861061DED5}.Release|x86.Build.0 = Release|Any CPU
54+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Debug|Any CPU.Build.0 = Debug|Any CPU
56+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
57+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
58+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Debug|x86.ActiveCfg = Debug|Any CPU
59+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Debug|x86.Build.0 = Debug|Any CPU
60+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Release|Any CPU.ActiveCfg = Release|Any CPU
61+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Release|Any CPU.Build.0 = Release|Any CPU
62+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
63+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
64+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Release|x86.ActiveCfg = Release|Any CPU
65+
{D164656E-D0E6-41A0-ADEA-37C55E34531B}.Release|x86.Build.0 = Release|Any CPU
66+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Debug|Any CPU.Build.0 = Debug|Any CPU
68+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
69+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
70+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Debug|x86.ActiveCfg = Debug|Any CPU
71+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Debug|x86.Build.0 = Debug|Any CPU
72+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Release|Any CPU.ActiveCfg = Release|Any CPU
73+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Release|Any CPU.Build.0 = Release|Any CPU
74+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
75+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Release|Mixed Platforms.Build.0 = Release|Any CPU
76+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Release|x86.ActiveCfg = Release|Any CPU
77+
{A4640FC9-F8A5-4B11-A9FE-8FEB626B2080}.Release|x86.Build.0 = Release|Any CPU
5078
EndGlobalSection
5179
GlobalSection(SolutionProperties) = preSolution
5280
HideSolutionNode = FALSE

UnitTesting/AdvancedSearchTest.cs

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
using System;
2-
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using RedditSharp.Things;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Xunit;
37
using System.Linq.Expressions;
48
using RedditSharp.Search;
5-
namespace UnitTesting
9+
namespace RedditSharp.UnitTesting
610
{
711

8-
[TestClass]
12+
913
public class AdvancedSearchTest
1014
{
11-
[TestCategory("AdvancedSearch"),TestMethod]
15+
[Fact]
1216
public void BoolPropertyTest()
1317
{
1418
//Arrange
@@ -22,10 +26,10 @@ public void BoolPropertyTest()
2226
string actual = searchFormatter.Format(expression);
2327

2428
//Assert
25-
Assert.AreEqual(expected, actual);
29+
Assert.Equal(expected, actual);
2630
}
2731

28-
[TestCategory("AdvancedSearch"), TestMethod]
32+
[Fact]
2933
public void NOT_BoolPropertyTest()
3034
{
3135
//Arrange
@@ -39,10 +43,10 @@ public void NOT_BoolPropertyTest()
3943
string actual = searchFormatter.Format(expression);
4044

4145
//Assert
42-
Assert.AreEqual(expected, actual);
46+
Assert.Equal(expected, actual);
4347
}
4448

45-
[TestCategory("AdvancedSearch"), TestMethod]
49+
[Fact]
4650
public void StringPropertyTest()
4751
{
4852
//Arrange
@@ -56,10 +60,10 @@ public void StringPropertyTest()
5660
string actual = searchFormatter.Format(expression);
5761

5862
//Assert
59-
Assert.AreEqual(expected, actual);
63+
Assert.Equal(expected, actual);
6064
}
6165

62-
[TestCategory("AdvancedSearch"), TestMethod]
66+
[Fact]
6367
public void Flipped_StringPropertyTest()
6468
{
6569
//Arrange
@@ -73,10 +77,10 @@ public void Flipped_StringPropertyTest()
7377
string actual = searchFormatter.Format(expression);
7478

7579
//Assert
76-
Assert.AreEqual(expected, actual);
80+
Assert.Equal(expected, actual);
7781
}
7882

79-
[TestCategory("AdvancedSearch"), TestMethod]
83+
[Fact]
8084
public void Not_StringPropertyTest()
8185
{
8286
//Arrange
@@ -90,10 +94,10 @@ public void Not_StringPropertyTest()
9094
string actual = searchFormatter.Format(expression);
9195

9296
//Assert
93-
Assert.AreEqual(expected, actual);
97+
Assert.Equal(expected, actual);
9498
}
9599

96-
[TestCategory("AdvancedSearch"), TestMethod]
100+
[Fact]
97101
public void AndAlsoTest()
98102
{
99103
//Arrange
@@ -107,10 +111,10 @@ public void AndAlsoTest()
107111
string actual = searchFormatter.Format(expression);
108112

109113
//Assert
110-
Assert.AreEqual(expected, actual);
114+
Assert.Equal(expected, actual);
111115
}
112116

113-
[TestCategory("AdvancedSearch"), TestMethod]
117+
[Fact]
114118
public void TwoString_AndAlsoTest()
115119
{
116120
//Arrange
@@ -124,10 +128,10 @@ public void TwoString_AndAlsoTest()
124128
string actual = searchFormatter.Format(expression);
125129

126130
//Assert
127-
Assert.AreEqual(expected, actual);
131+
Assert.Equal(expected, actual);
128132
}
129133

130-
[TestCategory("AdvancedSearch"), TestMethod]
134+
[Fact]
131135
public void TwoString_OrElseTest()
132136
{
133137
//Arrange
@@ -141,10 +145,10 @@ public void TwoString_OrElseTest()
141145
string actual = searchFormatter.Format(expression);
142146

143147
//Assert
144-
Assert.AreEqual(expected, actual);
148+
Assert.Equal(expected, actual);
145149
}
146150

147-
[TestCategory("AdvancedSearch"), TestMethod]
151+
[Fact]
148152
public void NotOrElseTest()
149153
{
150154
//Arrange
@@ -158,10 +162,10 @@ public void NotOrElseTest()
158162
string actual = searchFormatter.Format(expression);
159163

160164
//Assert
161-
Assert.AreEqual(expected, actual);
165+
Assert.Equal(expected, actual);
162166
}
163167

164-
[TestCategory("AdvancedSearch"), TestMethod]
168+
[Fact]
165169
public void AndNotOrElseTest()
166170
{
167171
//Arrange
@@ -175,10 +179,10 @@ public void AndNotOrElseTest()
175179
string actual = searchFormatter.Format(expression);
176180

177181
//Assert
178-
Assert.AreEqual(expected, actual);
182+
Assert.Equal(expected, actual);
179183
}
180184

181-
[TestCategory("AdvancedSearch"), TestMethod]
185+
[Fact]
182186
public void StringVariablePropertyTest()
183187
{
184188
//Arrange
@@ -193,10 +197,10 @@ public void StringVariablePropertyTest()
193197
string actual = searchFormatter.Format(expression);
194198

195199
//Assert
196-
Assert.AreEqual(expected, actual);
200+
Assert.Equal(expected, actual);
197201
}
198202

199-
[TestCategory("AdvancedSearch"), TestMethod]
203+
[Fact]
200204
public void ClassVariablePropertyTest()
201205
{
202206
//Arrange
@@ -212,7 +216,7 @@ public void ClassVariablePropertyTest()
212216
string actual = searchFormatter.Format(expression);
213217

214218
//Assert
215-
Assert.AreEqual(expected, actual);
219+
Assert.Equal(expected, actual);
216220
}
217221

218222
//[TestMethod]
@@ -230,7 +234,7 @@ public void ClassVariablePropertyTest()
230234
// string actual = searchFormatter.Format(expression);
231235

232236
// //Assert
233-
// Assert.AreEqual(expected, actual);
237+
// Assert.Equal(expected, actual);
234238
//}
235239

236240
private class Test

UnitTesting/MoreUnitTest.cs

Lines changed: 0 additions & 115 deletions
This file was deleted.

UnitTesting/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)