test: 增加单元测试

This commit is contained in:
Argo Zhang 2025-11-20 17:31:21 +08:00
parent 9ef1fc34ac
commit 3aa732d1ce

View File

@ -32,4 +32,11 @@ public class XdbTest
Assert.Equal(6, version.IPVer);
Assert.Equal(4, version.BytesCount);
}
[Fact]
public async Task GetVersionAsync_Error()
{
await Assert.ThrowsAsync<ArgumentNullException>(async () => await XDB.Util.GetVersionAsync(null));
await Assert.ThrowsAsync<FileNotFoundException>(async () => await XDB.Util.GetVersionAsync(Path.Combine(AppContext.BaseDirectory, "test.xdb")));
}
}