Skip to content

Commit 5d2184f

Browse files
Added test for DangerZone gamemode
1 parent efaaa73 commit 5d2184f

File tree

1 file changed

+46
-17
lines changed
  • tests/SourceEngine.Demo.Stats.Tests

1 file changed

+46
-17
lines changed

tests/SourceEngine.Demo.Stats.Tests/Tests.cs

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -208,24 +208,23 @@ public void Should_return_map_info_correctly_for_defuse_maps()
208208
allOutputData.AllStats.mapInfo.DemoName.ShouldBe("demo1");
209209
allOutputData.AllStats.mapInfo.MapName.ShouldBe("de_testmap");
210210
allOutputData.AllStats.mapInfo.GameMode.ShouldBe(Gamemodes.Defuse);
211-
allOutputData.AllStats.mapInfo.TestType.ShouldBe("Casual");
211+
allOutputData.AllStats.mapInfo.TestType.ShouldBe("casual");
212212
allOutputData.AllStats.mapInfo.TestDate.ShouldBe(new DateTime(2020, 1, 1, 0, 0, 0).ToString());
213213
}
214214

215215
[Fact]
216216
public void Should_return_map_info_correctly_for_hostage_maps()
217217
{
218218
// Arrange
219-
var ProcessedData2 = ProcessedData;
220-
ProcessedData2.DemoInformation = new DemoInformation()
219+
ProcessedData.DemoInformation = new DemoInformation()
221220
{
222221
DemoName = "demo2",
223222
MapName = "de_testmap2",
224223
GameMode = Gamemodes.Hostage,
225-
TestType = "Casual",
224+
TestType = "casual",
226225
TestDate = new DateTime(2020, 1, 1, 0, 0, 0).ToString(),
227226
};
228-
ProcessedData2.MatchStartValues = new List<MatchStartedEventArgs>()
227+
ProcessedData.MatchStartValues = new List<MatchStartedEventArgs>()
229228
{
230229
new MatchStartedEventArgs
231230
{
@@ -241,24 +240,23 @@ public void Should_return_map_info_correctly_for_hostage_maps()
241240
allOutputData.AllStats.mapInfo.DemoName.ShouldBe("demo2");
242241
allOutputData.AllStats.mapInfo.MapName.ShouldBe("de_testmap2");
243242
allOutputData.AllStats.mapInfo.GameMode.ShouldBe(Gamemodes.Hostage);
244-
allOutputData.AllStats.mapInfo.TestType.ShouldBe("Casual");
243+
allOutputData.AllStats.mapInfo.TestType.ShouldBe("casual");
245244
allOutputData.AllStats.mapInfo.TestDate.ShouldBe(new DateTime(2020, 1, 1, 0, 0, 0).ToString());
246245
}
247246

248247
[Fact]
249248
public void Should_return_map_info_correctly_for_wingman_defuse_maps()
250249
{
251250
// Arrange
252-
var ProcessedData3 = ProcessedData;
253-
ProcessedData3.DemoInformation = new DemoInformation()
251+
ProcessedData.DemoInformation = new DemoInformation()
254252
{
255253
DemoName = "demo3",
256254
MapName = "de_testmap3",
257255
GameMode = Gamemodes.WingmanDefuse,
258-
TestType = "Casual",
256+
TestType = "casual",
259257
TestDate = new DateTime(2020, 1, 1, 0, 0, 0).ToString(),
260258
};
261-
ProcessedData3.MatchStartValues = new List<MatchStartedEventArgs>()
259+
ProcessedData.MatchStartValues = new List<MatchStartedEventArgs>()
262260
{
263261
new MatchStartedEventArgs
264262
{
@@ -274,24 +272,23 @@ public void Should_return_map_info_correctly_for_wingman_defuse_maps()
274272
allOutputData.AllStats.mapInfo.DemoName.ShouldBe("demo3");
275273
allOutputData.AllStats.mapInfo.MapName.ShouldBe("de_testmap3");
276274
allOutputData.AllStats.mapInfo.GameMode.ShouldBe(Gamemodes.WingmanDefuse);
277-
allOutputData.AllStats.mapInfo.TestType.ShouldBe("Casual");
275+
allOutputData.AllStats.mapInfo.TestType.ShouldBe("casual");
278276
allOutputData.AllStats.mapInfo.TestDate.ShouldBe(new DateTime(2020, 1, 1, 0, 0, 0).ToString());
279277
}
280278

281279
[Fact]
282280
public void Should_return_map_info_correctly_for_wingman_hostage_maps()
283281
{
284282
// Arrange
285-
var ProcessedData3 = ProcessedData;
286-
ProcessedData3.DemoInformation = new DemoInformation()
283+
ProcessedData.DemoInformation = new DemoInformation()
287284
{
288285
DemoName = "demo4",
289286
MapName = "de_testmap4",
290287
GameMode = Gamemodes.WingmanHostage,
291-
TestType = "Casual",
288+
TestType = "casual",
292289
TestDate = new DateTime(2020, 1, 1, 0, 0, 0).ToString(),
293290
};
294-
ProcessedData3.MatchStartValues = new List<MatchStartedEventArgs>()
291+
ProcessedData.MatchStartValues = new List<MatchStartedEventArgs>()
295292
{
296293
new MatchStartedEventArgs
297294
{
@@ -307,7 +304,39 @@ public void Should_return_map_info_correctly_for_wingman_hostage_maps()
307304
allOutputData.AllStats.mapInfo.DemoName.ShouldBe("demo4");
308305
allOutputData.AllStats.mapInfo.MapName.ShouldBe("de_testmap4");
309306
allOutputData.AllStats.mapInfo.GameMode.ShouldBe(Gamemodes.WingmanHostage);
310-
allOutputData.AllStats.mapInfo.TestType.ShouldBe("Casual");
307+
allOutputData.AllStats.mapInfo.TestType.ShouldBe("casual");
308+
allOutputData.AllStats.mapInfo.TestDate.ShouldBe(new DateTime(2020, 1, 1, 0, 0, 0).ToString());
309+
}
310+
311+
[Fact]
312+
public void Should_return_map_info_correctly_for_danger_zone_maps()
313+
{
314+
// Arrange
315+
ProcessedData.DemoInformation = new DemoInformation()
316+
{
317+
DemoName = "demo5",
318+
MapName = "de_testmap5",
319+
GameMode = Gamemodes.DangerZone,
320+
TestType = "casual",
321+
TestDate = new DateTime(2020, 1, 1, 0, 0, 0).ToString(),
322+
};
323+
ProcessedData.MatchStartValues = new List<MatchStartedEventArgs>()
324+
{
325+
new MatchStartedEventArgs
326+
{
327+
Mapname = "de_testmap5",
328+
HasBombsites = false,
329+
}
330+
};
331+
332+
// Act
333+
AllOutputData allOutputData = MatchData.CreateFiles(ProcessedData, false);
334+
335+
// Assess
336+
allOutputData.AllStats.mapInfo.DemoName.ShouldBe("demo5");
337+
allOutputData.AllStats.mapInfo.MapName.ShouldBe("de_testmap5");
338+
allOutputData.AllStats.mapInfo.GameMode.ShouldBe(Gamemodes.DangerZone);
339+
allOutputData.AllStats.mapInfo.TestType.ShouldBe("casual");
311340
allOutputData.AllStats.mapInfo.TestDate.ShouldBe(new DateTime(2020, 1, 1, 0, 0, 0).ToString());
312341
}
313342

@@ -517,7 +546,7 @@ public void MockData()
517546
DemoName = "demo1",
518547
MapName = "de_testmap",
519548
GameMode = Gamemodes.Defuse,
520-
TestType = "Casual",
549+
TestType = "casual",
521550
TestDate = new DateTime(2020, 1, 1, 0, 0, 0).ToString(),
522551
};
523552

0 commit comments

Comments
 (0)