0e98e1cccd
* Refactor CI to run integration tests as separate workflow * Tool restore * correct cache path * conditionally use container registry * use sln because net8 * fix typo * Correct trait filter * Correct mistake again * fix again * fml * clarify names * hopefully we're properly filtering test categories now * maybe this? * What does this do? * revert is test project changes * IsTestProject fix * Correct test setup for automate * maybe fix unit tests * docker-compose-file alighment * remove debug * Ok tests should now pass
30 lines
650 B
C#
30 lines
650 B
C#
using System.Diagnostics.CodeAnalysis;
|
|
using Moq;
|
|
|
|
namespace Speckle.Sdk.Testing;
|
|
|
|
[ExcludeFromCodeCoverage]
|
|
public abstract class MoqTest : IDisposable
|
|
{
|
|
protected MoqTest() => Repository = new(MockBehavior.Strict);
|
|
|
|
protected virtual void Dispose(bool isDisposing)
|
|
{
|
|
if (isDisposing)
|
|
{
|
|
Repository.VerifyAll();
|
|
}
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Dispose(true);
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
|
|
protected MockRepository Repository { get; private set; } = new(MockBehavior.Strict);
|
|
|
|
protected Mock<T> Create<T>(MockBehavior behavior = MockBehavior.Strict)
|
|
where T : class => Repository.Create<T>(behavior);
|
|
}
|