mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-04-19 19:22:50 +08:00
41 lines
800 B
C#
41 lines
800 B
C#
using NSExt.Attributes;
|
|
using NSExt.Extensions;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace NSExt.Tests;
|
|
|
|
/// <summary>
|
|
/// 测试用例
|
|
/// </summary>
|
|
public class TestCase
|
|
{
|
|
private readonly ITestOutputHelper _testOutputHelper;
|
|
|
|
public TestCase(ITestOutputHelper testOutputHelper)
|
|
{
|
|
_testOutputHelper = testOutputHelper;
|
|
}
|
|
|
|
public enum MyEnum1
|
|
{
|
|
[ResourceDescription<TestCase>(nameof(Description))]
|
|
Online = 1
|
|
|
|
, Offline = 2
|
|
}
|
|
|
|
public static string Description { get; set; } = "123";
|
|
|
|
/// <summary>
|
|
/// Case1
|
|
/// </summary>
|
|
[Fact]
|
|
public void Case1()
|
|
{
|
|
var test = MyEnum1.Online.ResDesc<TestCase>();
|
|
|
|
_testOutputHelper.WriteLine(test);
|
|
Assert.True(test is not null);
|
|
}
|
|
} |