解决MySql布尔型新旧版本兼容问题,采用枚举来表示布尔型的数据表。由正向工程赋值
大石头 authored at 2018-05-15 21:21:05
414.00 B
X
using NewLife.Log;
using Xunit;

namespace XUnitTest.Log;

public class LoggerTests
{
    [Fact]
    public void FormatDateTime()
    {
        var dt = DateTime.Now;
        var log = new ConsoleLog();
        var str = log.Format("[{0:MM-dd}] {1} Test", [dt, Environment.MachineName]);
        var str2 = $"[{dt.Month:00}-{dt.Day:00}] {Environment.MachineName} Test";
        Assert.Equal(str2, str);
    }
}