From 1f0a93550588fa8a4df99af60fee9d68c75e71c3 Mon Sep 17 00:00:00 2001 From: Mole Date: Tue, 20 Oct 2020 14:44:30 +0200 Subject: [PATCH] Move MapperTestBase and ContentMapperTest into unit tests --- .../Persistance}/Mappers/ContentMapperTest.cs | 0 .../Persistance/Mappers/MapperTestBase.cs | 22 +++++++++++++++++++ src/Umbraco.Tests/Umbraco.Tests.csproj | 1 - 3 files changed, 22 insertions(+), 1 deletion(-) rename src/{Umbraco.Tests/Persistence => Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistance}/Mappers/ContentMapperTest.cs (100%) create mode 100644 src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistance/Mappers/MapperTestBase.cs diff --git a/src/Umbraco.Tests/Persistence/Mappers/ContentMapperTest.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistance/Mappers/ContentMapperTest.cs similarity index 100% rename from src/Umbraco.Tests/Persistence/Mappers/ContentMapperTest.cs rename to src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistance/Mappers/ContentMapperTest.cs diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistance/Mappers/MapperTestBase.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistance/Mappers/MapperTestBase.cs new file mode 100644 index 0000000000..8ab7d88b45 --- /dev/null +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistance/Mappers/MapperTestBase.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Concurrent; +using Moq; +using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.SqlSyntax; + +namespace Umbraco.Tests.Persistence.Mappers +{ + public class MapperTestBase + { + protected Lazy MockSqlContext() + { + var sqlContext = Mock.Of(); + var syntax = new SqlServerSyntaxProvider();; + Mock.Get(sqlContext).Setup(x => x.SqlSyntax).Returns(syntax); + return new Lazy(() => sqlContext); + } + + protected ConcurrentDictionary> CreateMaps() + => new ConcurrentDictionary>(); + } +} diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index e3c8c153b5..440cc0de06 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -289,7 +289,6 @@ -