From 047a0bf7d588c5fe1ee173b938f355c7304de9da Mon Sep 17 00:00:00 2001 From: SzymonPobiega Date: Fri, 23 Mar 2018 08:37:06 +0100 Subject: [PATCH 1/3] Support Json 11 and new mono.cecil --- GitVersion.yml | 2 +- src/ScriptBuilder.Tests/CecilExtensions/CustomAttributeMock.cs | 3 +++ src/SqlPersistence/SqlPersistence.csproj | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/GitVersion.yml b/GitVersion.yml index e191cd08d..4f6e16b93 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -2,6 +2,6 @@ assembly-versioning-scheme: Major next-version: 4.0 branches: develop: - tag: alpha + tag: beta release: tag: rc \ No newline at end of file diff --git a/src/ScriptBuilder.Tests/CecilExtensions/CustomAttributeMock.cs b/src/ScriptBuilder.Tests/CecilExtensions/CustomAttributeMock.cs index c9fe2a3e5..c5826ed92 100644 --- a/src/ScriptBuilder.Tests/CecilExtensions/CustomAttributeMock.cs +++ b/src/ScriptBuilder.Tests/CecilExtensions/CustomAttributeMock.cs @@ -32,10 +32,13 @@ TypeReference GetTypeReference(object value) public TypeReference AttributeType => throw new NotImplementedException(); public bool HasFields => throw new NotImplementedException(); public bool HasProperties => true; + public bool HasConstructorArguments => false; public Collection Fields => throw new NotImplementedException(); public Collection Properties { get; } + + public Collection ConstructorArguments { get; } = new Collection(); } \ No newline at end of file diff --git a/src/SqlPersistence/SqlPersistence.csproj b/src/SqlPersistence/SqlPersistence.csproj index ee4b647d8..05ae327f3 100644 --- a/src/SqlPersistence/SqlPersistence.csproj +++ b/src/SqlPersistence/SqlPersistence.csproj @@ -10,7 +10,7 @@ - + From e0aed552db6012beed130312e7f7662c780354cb Mon Sep 17 00:00:00 2001 From: SzymonPobiega Date: Fri, 23 Mar 2018 09:03:29 +0100 Subject: [PATCH 2/3] Add json references to test projects to resolve conflict with ObjectApproval --- src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj | 1 + src/ScriptBuilderTask.Tests/ScriptBuilderTask.Tests.csproj | 1 + src/SqlPersistence.Tests/SqlPersistence.Tests.csproj | 1 + 3 files changed, 3 insertions(+) diff --git a/src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj b/src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj index 6c4455fe4..8fe67f48b 100644 --- a/src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj +++ b/src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj @@ -14,6 +14,7 @@ + diff --git a/src/ScriptBuilderTask.Tests/ScriptBuilderTask.Tests.csproj b/src/ScriptBuilderTask.Tests/ScriptBuilderTask.Tests.csproj index e50e64aee..8a8e32cf7 100644 --- a/src/ScriptBuilderTask.Tests/ScriptBuilderTask.Tests.csproj +++ b/src/ScriptBuilderTask.Tests/ScriptBuilderTask.Tests.csproj @@ -14,6 +14,7 @@ + diff --git a/src/SqlPersistence.Tests/SqlPersistence.Tests.csproj b/src/SqlPersistence.Tests/SqlPersistence.Tests.csproj index fd8c7acfb..9f4f9c995 100644 --- a/src/SqlPersistence.Tests/SqlPersistence.Tests.csproj +++ b/src/SqlPersistence.Tests/SqlPersistence.Tests.csproj @@ -15,6 +15,7 @@ + From 84a11778d16eff235f2867ffd1e3e98094116d8c Mon Sep 17 00:00:00 2001 From: SzymonPobiega Date: Fri, 23 Mar 2018 10:20:24 +0100 Subject: [PATCH 3/3] Updated ObjectApproval to 2.* --- .../ScriptBuilder.Tests.csproj | 3 +-- src/ScriptBuilder.Tests/SetUpFixture.cs | 4 ++++ .../ScriptBuilderTask.Tests.csproj | 3 +-- src/ScriptBuilderTask.Tests/SetUpFixture.cs | 23 +++++++++++++++++++ src/SqlPersistence.Tests/SetUpFixture.cs | 4 ++++ .../SqlPersistence.Tests.csproj | 3 +-- 6 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 src/ScriptBuilderTask.Tests/SetUpFixture.cs diff --git a/src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj b/src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj index 8fe67f48b..f3529bca0 100644 --- a/src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj +++ b/src/ScriptBuilder.Tests/ScriptBuilder.Tests.csproj @@ -14,7 +14,6 @@ - @@ -22,7 +21,7 @@ - + diff --git a/src/ScriptBuilder.Tests/SetUpFixture.cs b/src/ScriptBuilder.Tests/SetUpFixture.cs index 4e1488569..87e82d963 100644 --- a/src/ScriptBuilder.Tests/SetUpFixture.cs +++ b/src/ScriptBuilder.Tests/SetUpFixture.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Runtime.CompilerServices; +using Newtonsoft.Json; using NUnit.Framework; [SetUpFixture] @@ -9,6 +10,9 @@ public class SetUpFixture [OneTimeSetUp] public void SetUp() { +#if NET452 + ObjectApproval.ObjectApprover.JsonSerializer.DefaultValueHandling = DefaultValueHandling.Include; +#endif FixCurrentDirectory(); } diff --git a/src/ScriptBuilderTask.Tests/ScriptBuilderTask.Tests.csproj b/src/ScriptBuilderTask.Tests/ScriptBuilderTask.Tests.csproj index 8a8e32cf7..acb7dc054 100644 --- a/src/ScriptBuilderTask.Tests/ScriptBuilderTask.Tests.csproj +++ b/src/ScriptBuilderTask.Tests/ScriptBuilderTask.Tests.csproj @@ -14,14 +14,13 @@ - - + \ No newline at end of file diff --git a/src/ScriptBuilderTask.Tests/SetUpFixture.cs b/src/ScriptBuilderTask.Tests/SetUpFixture.cs new file mode 100644 index 000000000..87e82d963 --- /dev/null +++ b/src/ScriptBuilderTask.Tests/SetUpFixture.cs @@ -0,0 +1,23 @@ +using System; +using System.IO; +using System.Runtime.CompilerServices; +using Newtonsoft.Json; +using NUnit.Framework; + +[SetUpFixture] +public class SetUpFixture +{ + [OneTimeSetUp] + public void SetUp() + { +#if NET452 + ObjectApproval.ObjectApprover.JsonSerializer.DefaultValueHandling = DefaultValueHandling.Include; +#endif + FixCurrentDirectory(); + } + + void FixCurrentDirectory([CallerFilePath] string callerFilePath="") + { + Environment.CurrentDirectory = Directory.GetParent(callerFilePath).FullName; + } +} \ No newline at end of file diff --git a/src/SqlPersistence.Tests/SetUpFixture.cs b/src/SqlPersistence.Tests/SetUpFixture.cs index 97558d7bb..5205ad331 100644 --- a/src/SqlPersistence.Tests/SetUpFixture.cs +++ b/src/SqlPersistence.Tests/SetUpFixture.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Runtime.CompilerServices; +using Newtonsoft.Json; using NUnit.Framework; [SetUpFixture] @@ -9,6 +10,9 @@ public class SetUpFixture [OneTimeSetUp] public void SetUp() { +#if NET452 + ObjectApproval.ObjectApprover.JsonSerializer.DefaultValueHandling = DefaultValueHandling.Include; +#endif FixCurrentDirectory(); using (var connection = MsSqlConnectionBuilder.Build()) { diff --git a/src/SqlPersistence.Tests/SqlPersistence.Tests.csproj b/src/SqlPersistence.Tests/SqlPersistence.Tests.csproj index 9f4f9c995..7fbb4f4ee 100644 --- a/src/SqlPersistence.Tests/SqlPersistence.Tests.csproj +++ b/src/SqlPersistence.Tests/SqlPersistence.Tests.csproj @@ -15,7 +15,6 @@ - @@ -23,7 +22,7 @@ - +