mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-27 15:40:32 -05:00
QOL updates for profile meta
implement filterable meta for issue #158 update translations and use humanizer lib with datetime/timespan for issue #80
This commit is contained in:
28
Tests/ApplicationTests/Fixtures/PenaltyGenerators.cs
Normal file
28
Tests/ApplicationTests/Fixtures/PenaltyGenerators.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using SharedLibraryCore.Database.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ApplicationTests.Fixtures
|
||||
{
|
||||
class PenaltyGenerators
|
||||
{
|
||||
public static EFPenalty Create(EFPenalty.PenaltyType type = EFPenalty.PenaltyType.Ban, EFClient originClient = null, EFClient targetClient = null, DateTime? occurs = null, string reason = null)
|
||||
{
|
||||
originClient ??= ClientGenerators.CreateDatabaseClient(clientId: 1);
|
||||
targetClient ??= ClientGenerators.CreateDatabaseClient(clientId: 2);
|
||||
occurs ??= DateTime.UtcNow;
|
||||
reason ??= "test";
|
||||
|
||||
return new EFPenalty()
|
||||
{
|
||||
Offender = targetClient,
|
||||
Punisher = originClient,
|
||||
When = occurs.Value,
|
||||
Offense = reason,
|
||||
Type = type,
|
||||
LinkId = targetClient.AliasLinkId
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user