Changes necessary for migrating old tests

This commit is contained in:
Elitsa Marinovska
2020-08-18 15:53:25 +02:00
parent 6371fdbf4d
commit 4f5fb0c9c3
6 changed files with 13 additions and 6 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
namespace Umbraco.Tests.TestHelpers.Entities
{

View File

@@ -1,12 +1,16 @@
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Strings;
namespace Umbraco.Tests.TestHelpers.Entities
{
public class MockedUserGroup
{
internal static UserGroup CreateUserGroup(string suffix = "", string[] permissions = null, string[] allowedSections = null)
public static IShortStringHelper ShortStringHelper { get; } =
new DefaultShortStringHelper(new DefaultShortStringHelperConfig());
public static UserGroup CreateUserGroup(string suffix = "", string[] permissions = null, string[] allowedSections = null)
{
var group = new UserGroup(TestHelper.ShortStringHelper)
var group = new UserGroup(ShortStringHelper)
{
Alias = "testUserGroup" + suffix,
Name = "TestUserGroup" + suffix,

View File

@@ -99,10 +99,11 @@ namespace Umbraco.Tests.Integration.Extensions
break;
case UmbracoTestOptions.Database.NewSchemaPerFixture:
throw new NotImplementedException();
// New DB + Schema
var newSchemaFixtureDbId = db.AttachSchema();
//// Add teardown callback
//integrationTest.OnFixtureTearDown(() => db.Detach());
// Add teardown callback
integrationTest.OnFixtureTearDown(() => db.Detach(newSchemaFixtureDbId));
break;
case UmbracoTestOptions.Database.NewEmptyPerFixture:

View File

@@ -19,6 +19,7 @@ using Umbraco.Tests.Testing;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Cache;
using Umbraco.Core.PropertyEditors;
using Umbraco.Tests.Common.TestHelpers.Entities;
using Umbraco.Tests.LegacyXmlPublishedCache;
namespace Umbraco.Tests.Services

View File

@@ -13,8 +13,10 @@ using Umbraco.Tests.TestHelpers.Entities;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
using Umbraco.Tests.Common.TestHelpers.Entities;
using Umbraco.Tests.Testing;
using Umbraco.Web.Actions;
using MockedUser = Umbraco.Tests.TestHelpers.Entities.MockedUser;
namespace Umbraco.Tests.Services