-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Wrong action count for specific user statistics
- Loading branch information
Showing
19 changed files
with
268 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
public class AnalyzeTrainingRequest | ||
{ | ||
public List<Guid?>? Users { get; set; } | ||
public int? Years { get; set; } | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/Drogecode.Knrm.Oefenrooster.TestServer/Seeds/SeedCustomer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Drogecode.Knrm.Oefenrooster.Server.Database.Models; | ||
|
||
namespace Drogecode.Knrm.Oefenrooster.TestServer.Seeds; | ||
|
||
public class SeedCustomer | ||
{ | ||
public static void Seed(DataContext dataContext, Guid defaultCustomerId) | ||
{ | ||
dataContext.Customers.Add(new DbCustomers | ||
{ | ||
Id = defaultCustomerId, | ||
Name = "xUnit customer", | ||
TimeZone = "Europe/Amsterdam", | ||
Created = DateTime.UtcNow | ||
}); | ||
dataContext.SaveChanges(); | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
tests/Drogecode.Knrm.Oefenrooster.TestServer/Seeds/SeedReportAction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using Drogecode.Knrm.Oefenrooster.Server.Database.Models; | ||
using Drogecode.Knrm.Oefenrooster.Shared.Helpers; | ||
|
||
namespace Drogecode.Knrm.Oefenrooster.TestServer.Seeds; | ||
|
||
public static class SeedReportAction | ||
{ | ||
public static void Seed(DataContext dataContext, Guid defaultCustomerId) | ||
{ | ||
SeedForYear(dataContext, defaultCustomerId, 2022); | ||
SeedForYear(dataContext, defaultCustomerId, 2020); | ||
SeedForYear(dataContext, defaultCustomerId, 2019); | ||
SeedForYear(dataContext, defaultCustomerId, 2018); | ||
SeedForYear(dataContext, defaultCustomerId, 2016); | ||
SeedForYear(dataContext, defaultCustomerId, 2012); | ||
SeedForYear(dataContext, defaultCustomerId, 2004); | ||
dataContext.SaveChanges(); | ||
} | ||
|
||
private static void SeedForYear(DataContext dataContext, Guid defaultCustomerId, int year) | ||
{ | ||
var start = new DateTime(year, 3, 8, 8, 5, 41); | ||
dataContext.ReportActions.Add(new DbReportAction | ||
{ | ||
Id = Guid.NewGuid(), | ||
CustomerId = defaultCustomerId, | ||
Description = "xUnit Description A", | ||
Start = start, | ||
Commencement = start.AddMinutes(5), | ||
Departure = start.AddMinutes(15), | ||
End = start.AddMinutes(121), | ||
Boat = "xUnit boat", | ||
Prio = "Prio 69", | ||
Users = new List<DbReportUser>{new DbReportUser{DrogeCodeId = DefaultSettingsHelper.IdTaco}}, | ||
}); | ||
start = start.AddDays(1); | ||
dataContext.ReportActions.Add(new DbReportAction | ||
{ | ||
Id = Guid.NewGuid(), | ||
CustomerId = defaultCustomerId, | ||
Description = "xUnit Description B", | ||
Start = start, | ||
Commencement = start.AddMinutes(5), | ||
Departure = start.AddMinutes(15), | ||
End = start.AddMinutes(121), | ||
Boat = "xUnit boat", | ||
Prio = "Prio 1", | ||
Users = new List<DbReportUser>{new DbReportUser{DrogeCodeId = DefaultSettingsHelper.IdTaco}}, | ||
}); | ||
start = start.AddMonths(1); | ||
dataContext.ReportActions.Add(new DbReportAction | ||
{ | ||
Id = Guid.NewGuid(), | ||
CustomerId = defaultCustomerId, | ||
Description = "xUnit Description C", | ||
Start = start, | ||
Commencement = start.AddMinutes(5), | ||
Departure = start.AddMinutes(15), | ||
End = start.AddMinutes(121), | ||
Boat = "xUnit boat", | ||
Prio = "Prio 1", | ||
Users = new List<DbReportUser>{new DbReportUser{DrogeCodeId = DefaultSettingsHelper.IdTaco}}, | ||
}); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
tests/Drogecode.Knrm.Oefenrooster.TestServer/Seeds/SeedReportTraining.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Drogecode.Knrm.Oefenrooster.Server.Database.Models; | ||
using Drogecode.Knrm.Oefenrooster.Shared.Helpers; | ||
|
||
namespace Drogecode.Knrm.Oefenrooster.TestServer.Seeds; | ||
|
||
public static class SeedReportTraining | ||
{ | ||
public static void Seed(DataContext dataContext, Guid defaultCustomerId) | ||
{ | ||
SeedForYear(dataContext, defaultCustomerId, 2022); | ||
SeedForYear(dataContext, defaultCustomerId, 2020); | ||
SeedForYear(dataContext, defaultCustomerId, 2019); | ||
SeedForYear(dataContext, defaultCustomerId, 2018); | ||
SeedForYear(dataContext, defaultCustomerId, 2016); | ||
SeedForYear(dataContext, defaultCustomerId, 2012); | ||
SeedForYear(dataContext, defaultCustomerId, 2004); | ||
dataContext.SaveChanges(); | ||
} | ||
|
||
private static void SeedForYear(DataContext dataContext, Guid defaultCustomerId, int year) | ||
{ | ||
var start = new DateTime(year, 3, 8, 8, 5, 41); | ||
dataContext.ReportTrainings.Add(new DbReportTraining | ||
{ | ||
Id = Guid.NewGuid(), | ||
CustomerId = defaultCustomerId, | ||
Description = "xUnit Description A", | ||
Start = start, | ||
Commencement = start.AddMinutes(5), | ||
End = start.AddMinutes(121), | ||
Boat = "xUnit boat", | ||
Users = new List<DbReportUser> { new DbReportUser { DrogeCodeId = DefaultSettingsHelper.IdTaco } }, | ||
}); | ||
start = start.AddDays(1); | ||
dataContext.ReportTrainings.Add(new DbReportTraining | ||
{ | ||
Id = Guid.NewGuid(), | ||
CustomerId = defaultCustomerId, | ||
Description = "xUnit Description B", | ||
Start = start, | ||
Commencement = start.AddMinutes(5), | ||
End = start.AddMinutes(121), | ||
Boat = "xUnit boat", | ||
Users = new List<DbReportUser> { new DbReportUser { DrogeCodeId = DefaultSettingsHelper.IdTaco } }, | ||
}); | ||
start = start.AddMonths(1); | ||
dataContext.ReportTrainings.Add(new DbReportTraining | ||
{ | ||
Id = Guid.NewGuid(), | ||
CustomerId = defaultCustomerId, | ||
Description = "xUnit Description C", | ||
Start = start, | ||
Commencement = start.AddMinutes(5), | ||
End = start.AddMinutes(121), | ||
Boat = "xUnit boat", | ||
Users = new List<DbReportUser> { new DbReportUser { DrogeCodeId = DefaultSettingsHelper.IdTaco } }, | ||
}); | ||
} | ||
} |
Oops, something went wrong.