Smartstore.BTCPayServer/test/Smartstore.Test.Common/TestsBase.cs
2022-08-03 21:33:05 +02:00

32 lines
709 B
C#

using System.Security.Principal;
using Moq;
using NUnit.Framework;
namespace Smartstore.Test.Common
{
public abstract class TestsBase
{
protected MockRepository mocks;
[OneTimeSetUp]
public virtual void SetUp()
{
mocks = new MockRepository(MockBehavior.Loose);
}
[TearDown]
public virtual void TearDown()
{
if (mocks != null)
{
mocks.VerifyAll();
}
}
protected static IPrincipal CreatePrincipal(string name, params string[] roles)
{
return new GenericPrincipal(new GenericIdentity(name, "TestIdentity"), roles);
}
}
}