Matt Wise
12/30/2022, 1:31 PMSystem.ApplicationException : Unsupported test database provider
Shorten code sample:
[TestFixture]
[UmbracoTest(Database = UmbracoTestOptions.Database.NewEmptyPerTest)]
public class CspServiceTests : UmbracoIntegrationTest
{
[Test]
[TestCase(false)]
[TestCase(true)]
public void GetCspDefinition_ReturnsDefaultDefinitionIfNoneIsStored(bool isBackOffice)
{
var _sud = new CspService(GetRequiredService<IEventAggregator>(),
GetRequiredService<IHostingEnvironment>(),
ScopeProvider,
AppCaches);
var definition = _sud.GetCspDefinition(isBackOffice);
definition.Should().NotBeNull();
definition.IsBackOffice.Should().Be(isBackOffice);
definition.Enabled.Should().BeFalse();
definition.Id.Should().Be(isBackOffice ? CspConstants.DefaultBackofficeId : CspConstants.DefaultFrontEndId);
}
}
Benji
12/30/2022, 1:50 PMMatt Wise
12/30/2022, 1:51 PMMatt Wise
12/30/2022, 1:54 PMMatt Wise
12/30/2022, 2:01 PMappsettings.Tests.json
file in your project having the linked one wont work. You also need a class with no namespace that inheirts from GlobalSetupTeardown
to get GlobalSetupTeardown to runBenji
12/30/2022, 2:05 PMMatt Wise
12/30/2022, 2:20 PMMatt Wise
12/30/2022, 2:30 PM