Initial commit: SWP.Core enterprise framework with multi-tenant architecture, configuration management, security, telemetry and comprehensive test suite
This commit is contained in:
commit
5275a75502
87 changed files with 6140 additions and 0 deletions
33
Tests/TestHelpers/TestFixtureBase.cs
Normal file
33
Tests/TestHelpers/TestFixtureBase.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
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"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue