14d959834f
* xunit unit tests * most pass with formatting * convert objects to xunit * remove nunit * format * merge fixes * switch objects to fluent assertions * update to fluent assertions * more FA * convert all to FA * Format * Fix tests * formatting * hopefully made credential test better * Catch more specific exception * use another more specific exception * Fix tests * update to xunit * update packages
27 lines
764 B
C#
27 lines
764 B
C#
using Microsoft.Data.Sqlite;
|
|
using Speckle.Sdk.SQLite;
|
|
using Xunit;
|
|
|
|
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)))
|
|
);
|
|
}
|
|
}
|