mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
26 lines
518 B
C#
26 lines
518 B
C#
using System.Text.Json;
|
|
using Netch;
|
|
|
|
namespace UnitTest
|
|
{
|
|
public class TestBase
|
|
{
|
|
private readonly JsonSerializerOptions _serializerSettings = new()
|
|
{
|
|
WriteIndented = true,
|
|
IgnoreNullValues = true
|
|
};
|
|
|
|
protected TestBase()
|
|
{
|
|
#if DEBUG
|
|
Global.Testing = true;
|
|
#endif
|
|
}
|
|
|
|
protected string JsonSerializerFormatted(object o)
|
|
{
|
|
return JsonSerializer.Serialize(o, _serializerSettings);
|
|
}
|
|
}
|
|
} |