a84e6d89ca
* Update to csharpier 1.0 * Fix check and nowarn * format
26 lines
749 B
C#
26 lines
749 B
C#
using Microsoft.Data.Sqlite;
|
|
using Speckle.Sdk.SQLite;
|
|
|
|
namespace Speckle.Sdk.Tests.Unit.SQLite;
|
|
|
|
public class SqLiteJsonCacheExceptionTests
|
|
{
|
|
[Fact]
|
|
public void ExpectedExceptionFires_Void()
|
|
{
|
|
using var pool = new CacheDbCommandPool("DataSource=:memory:", 1);
|
|
Assert.Throws<SqLiteJsonCacheException>(() =>
|
|
pool.Use(CacheOperation.Get, new Action<SqliteCommand>(_ => throw new SqliteException("test", 1, 1)))
|
|
);
|
|
}
|
|
|
|
[Fact]
|
|
public void ExpectedExceptionFires_Return()
|
|
{
|
|
using var pool = new CacheDbCommandPool("DataSource=:memory:", 1);
|
|
Assert.Throws<SqLiteJsonCacheException>(() =>
|
|
pool.Use(CacheOperation.Get, new Func<SqliteCommand, bool>(_ => throw new SqliteException("test", 1, 1)))
|
|
);
|
|
}
|
|
}
|