1
0
Files
common/UnitTests/Common/Utils/JsonTestClass.cs

51 lines
1.2 KiB
C#

using System;
namespace UnitTests.Common.Utils
{
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal class JsonTestClass
{
public string StringValue { get; set; } = "Hello World!";
public bool IsBoolTrue { get; set; } = true;
public float FloatValue { get; set; } = 12.34f;
public double DoubleValue { get; set; } = 21.42;
public decimal DecimalValue { get; set; } = 42.21m;
public DateTime LocalTimestamp { get; set; } = new(2021, 11, 16, 20, 15, 34, DateTimeKind.Local);
public DateTime UtcTimestamp { get; set; } = new(2021, 11, 16, 20, 15, 34, DateTimeKind.Utc);
public JsonTestSubClass Object { get; set; } = new();
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal class JsonTestSubClass
{
public int IntegerValue { get; set; } = 42;
public string StringValue { get; set; } = "Foo-Bar";
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
internal class JsonErrorClass
{
private int? number;
public int Number
{
get
{
if (number.HasValue)
return number.Value;
throw new Exception("Null value");
}
set { number = value; }
}
}
}