From 8404ae63c08accbf5e014bbb9199f22432e7ddfe Mon Sep 17 00:00:00 2001 From: Mole Date: Mon, 5 Oct 2020 08:13:52 +0200 Subject: [PATCH] Change HasSchema to CanAttachSchema in LocalDbTestDatabase It's more indicative of what it's actually checking for. --- .../Packaging/CreatedPackagesRepositoryTests.cs | 1 - .../Testing/LocalDbTestDatabase.cs | 8 +------- .../Testing/UmbracoIntegrationTest.cs | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Tests.Integration/Packaging/CreatedPackagesRepositoryTests.cs b/src/Umbraco.Tests.Integration/Packaging/CreatedPackagesRepositoryTests.cs index 53b81fba8a..6f91bc3c26 100644 --- a/src/Umbraco.Tests.Integration/Packaging/CreatedPackagesRepositoryTests.cs +++ b/src/Umbraco.Tests.Integration/Packaging/CreatedPackagesRepositoryTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.IO.Compression; using System.Linq; -using System.Threading; using System.Threading.Tasks; using System.Xml.Linq; using NUnit.Framework; diff --git a/src/Umbraco.Tests.Integration/Testing/LocalDbTestDatabase.cs b/src/Umbraco.Tests.Integration/Testing/LocalDbTestDatabase.cs index 09c0a994c9..9194747034 100644 --- a/src/Umbraco.Tests.Integration/Testing/LocalDbTestDatabase.cs +++ b/src/Umbraco.Tests.Integration/Testing/LocalDbTestDatabase.cs @@ -25,13 +25,7 @@ namespace Umbraco.Tests.Integration.Testing public const string InstanceName = "UmbracoTests"; public const string DatabaseName = "UmbracoTests"; - public bool HasSchema - { - get - { - return !(_schemaPool is null) && !_schemaPool.CanAttach; - } - } + public bool CanAttachSchema => _schemaPool is null || _schemaPool.CanAttach; private readonly ILogger _logger; private readonly LocalDb _localDb; diff --git a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs index d4dd610f75..94b2f30694 100644 --- a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs +++ b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs @@ -370,7 +370,7 @@ namespace Umbraco.Tests.Integration.Testing // Probably because the DB is blocked because it hasn't been detached // Also if we attach a new schema for every test isn't it just essentially // the same as NewSchemaPerTest? - if (!db.HasSchema) + if (db.CanAttachSchema) { // New DB + Schema var newSchemaFixtureDbId = db.AttachSchema();