33 lines
No EOL
920 B
C#
33 lines
No EOL
920 B
C#
using Microsoft.Extensions.Configuration;
|
|
using SWP.Core.Entities.Users;
|
|
|
|
namespace SWP.Core.X.TDD.TestHelpers;
|
|
|
|
public static class TestDataBuilder
|
|
{
|
|
public static class Users
|
|
{
|
|
public static User CreateTestUser(string email = null)
|
|
{
|
|
return new User
|
|
{
|
|
Id = new Random().Next(1, 1000),
|
|
Email = email ?? $"test{Guid.NewGuid()}@example.com",
|
|
EmailConfirmed = false,
|
|
CreatedDate = DateTime.UtcNow
|
|
};
|
|
}
|
|
}
|
|
|
|
public static class Configuration
|
|
{
|
|
public static Dictionary<string, string> CreateTestConfiguration()
|
|
{
|
|
return new Dictionary<string, string>
|
|
{
|
|
["Database:ConnectionString"] = "Host=localhost;Database=test",
|
|
["Logging:Level"] = "Debug"
|
|
};
|
|
}
|
|
}
|
|
} |