From e1ba070e2eba770ed15b11f174ae5835aac08272 Mon Sep 17 00:00:00 2001 From: Seth Gransky Date: Tue, 24 Mar 2020 13:44:00 -0500 Subject: [PATCH 1/5] Try dotnet core 2. --- .travis.yml | 4 +++- rosette_api/rosette_api.csproj | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e3a6a409..77c12741 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,12 @@ language: csharp +mono: none +dotnet: 2.1.502 install: - nuget restore rosette_api.sln script: + - dotnet restore - xbuild /p:Configuration=Release rosette_api.sln - mono ./packages/NUnit.Console.3.0.1/tools/nunit3-console.exe ./rosette_apiUnitTests/bin/Release/rosette_apiUnitTests.dll @@ -13,4 +16,3 @@ notifications: - secure: 4FRaTAAiYyeUvgw2RhmblgbNiJO4wmd34OBgWcwURjP9oVmFfSwR9r1LNCdUGxrPOghexSY2DjXIuvIrfTfi/xYbhHb3Kw7PEAyB8IuBMlKtY4NSFou62S2VhYpxyg58T+C7P2zi0eDnDE06pwTCoGPaimxMZQY91yQ0yPYDPVXbwe5SjEgamzlwGBxlS/0A6w1iCPHg27/iO2hXtdW3oLS2I0F/Q8Q95RBkX9hpg6yqHlTV7jRbSqvQ9OFBqk/tXMHQvhoPDGgCgQDuykJuaAYx7g9d0YL0eEYYOh9B/TJ/kNOwdRFBu5kuQ2/nFS5Z0S3Y3UIhdYjUmm9gSMnwIbYnrW22EqDJLoT9Zi3Gv7Prg/8/fSkWsof7BJTMSuXUqO1AxDGKIxFv9uSF1daZoY+AC1ooU1xDu1nNvWVYPlkwEdDxxmHpFkGT3ESTZYccPovQl8Z5K0I1BBAVdJKDzm07lE6VHbxkKcvK6gG0TN3uLxnSlQtjkfJ+aVMq1kxeVsB9lEsKs9oezsKzzbftMm525aXPg+OAv+31CUFWxvT/p4ps8Q+AV6aZpoPHkpK8VryyNirUeZ/m4m4ebDHhD9vcN+JqE9gzshT+0U3g19SvLiUMQtbuZ2BUvr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Hk4zGMoSl+L6al+nFo/3h2dXeebrQ0tY/hRfZi4Q8xwqG9083TBqi71fTpoFZ7sNtrY4Kdtl5Oa2CFUo7lVn1JB9qQwSa0eai3Whv0RyRqqQe77aDUj0dfD2R3Q61rX5OF/f++W0XtNwHQubzmj8HD/cFneShIQsbl9KgYXoR6HiXcbBiNdmmZjSrzkPYh7vlsujYrz6Cg2msKybWJ/FfOz0tS1cjlCtiCMOTExN6tEF8YCp9l+s+5RLe61pgFPy4Snr9pEjuTS5DYliTyZMY2ZZC1clBQtgE8E2qCG1QSzqnqqiGxj2K4zmLPpB4y1XpW8e3yk= - diff --git a/rosette_api/rosette_api.csproj b/rosette_api/rosette_api.csproj index da63c045..1d643044 100644 --- a/rosette_api/rosette_api.csproj +++ b/rosette_api/rosette_api.csproj @@ -9,7 +9,7 @@ Properties rosette_api rosette_api - v4.5 + netstandard2.0 512 From 5bedc32fa46c17bad0f640680b26ecf7f7933681 Mon Sep 17 00:00:00 2001 From: tstojecki Date: Sat, 4 Apr 2020 18:45:39 +0200 Subject: [PATCH 2/5] netstandard 2 --- .github/workflows/dotnetcore.yml | 25 +++ .gitmodules | 0 .travis.yml | 16 -- Jenkinsfile | 30 ---- Jenkinsfile.examples | 36 ---- rosette_api.sln | 66 ++++---- .../IEnumerableExpanderContractResolver.cs | 28 ---- rosette_api/Properties/AssemblyInfo.cs | 36 ---- rosette_api/Properties/Resources.Designer.cs | 63 ------- rosette_api/Properties/Resources.resx | 117 ------------- rosette_api/Properties/Settings.Designer.cs | 26 --- rosette_api/Properties/Settings.settings | 7 - rosette_api/app.config | 3 - rosette_api/packages.config | 5 - rosette_api/rosette_api.csproj | 132 ++------------- .../Properties/AssemblyInfo.cs | 33 ---- rosette_apiUnitTests/app.config | 11 -- rosette_apiUnitTests/packages.config | 14 -- rosette_apiUnitTests/rosette_apiUnitTests.cs | 47 +++--- .../rosette_apiUnitTests.csproj | 156 ++---------------- 20 files changed, 109 insertions(+), 742 deletions(-) create mode 100644 .github/workflows/dotnetcore.yml delete mode 100644 .gitmodules delete mode 100644 .travis.yml delete mode 100644 Jenkinsfile delete mode 100644 Jenkinsfile.examples delete mode 100644 rosette_api/IEnumerableExpanderContractResolver.cs delete mode 100644 rosette_api/Properties/AssemblyInfo.cs delete mode 100644 rosette_api/Properties/Resources.Designer.cs delete mode 100644 rosette_api/Properties/Resources.resx delete mode 100644 rosette_api/Properties/Settings.Designer.cs delete mode 100644 rosette_api/Properties/Settings.settings delete mode 100644 rosette_api/app.config delete mode 100755 rosette_api/packages.config delete mode 100644 rosette_apiUnitTests/Properties/AssemblyInfo.cs delete mode 100755 rosette_apiUnitTests/app.config delete mode 100755 rosette_apiUnitTests/packages.config diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml new file mode 100644 index 00000000..0a653ed5 --- /dev/null +++ b/.github/workflows/dotnetcore.yml @@ -0,0 +1,25 @@ +name: .NET Core + +on: + push: + branches: [ netstandard2 ] + pull_request: + branches: [ develop ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.101 + - name: Install dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --no-restore --verbosity normal diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29b..00000000 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e3a6a409..00000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: csharp - -install: - - nuget restore rosette_api.sln - -script: - - xbuild /p:Configuration=Release rosette_api.sln - - mono ./packages/NUnit.Console.3.0.1/tools/nunit3-console.exe ./rosette_apiUnitTests/bin/Release/rosette_apiUnitTests.dll - -notifications: - slack: - rooms: - - secure: 4FRaTAAiYyeUvgw2RhmblgbNiJO4wmd34OBgWcwURjP9oVmFfSwR9r1LNCdUGxrPOghexSY2DjXIuvIrfTfi/xYbhHb3Kw7PEA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TjfoMcJ3ISjGNHRmUwcCH9avcaHqMLPLHht0z+8inVlDZeTcN+Wi8tk1YXwuQYUkTW46iFmoZNGdygRjTu43h9hCqdG7vcoKrR8oDbMT8X/sfs+z/UaBbuYBr9dT8rrdKJoa9115PaYpCs529DLrw1iGmzr5CkAXDElc1y2F352nwVS+dX7/OIQz1/dbT1ozWQ9Blx6ez5XN84= -# - secure: g/eOC2QCn7oUW234u/P1kmh9OASO9t5g6iC+DflNdnedHnpw8IEG9CsLAnNynOY0KvC/2/Q6BAIFpT/qO8BPdaC2eQnd9LDurOXExxvjKZgTujhqgzijJGzVPSL8//hafj0Ec2+iJZFo/DYMPqUpYDsiKxX53+SMz9/GN/PKVKsI7bzuaOm04xXktU0A76pVfaG0N/qFSVHI64SShACoUXRpTzyUbmksRgzk7FB162R+TH1soPsR3vPh8c2SSWC9msrDc4iljcBhSFTdjL68z+srjDPYMSoOcFXXFNP+dmL+Q0veL/E4e40e7CWIU1O3grOcEcCkaSoZVSpGduNnCst8h6MpgauPtrgwHk4zGMoSl+L6al+nFo/3h2dXeebrQ0tY/hRfZi4Q8xwqG9083TBqi71fTpoFZ7sNtrY4Kdtl5Oa2CFUo7lVn1JB9qQwSa0eai3Whv0RyRqqQe77aDUj0dfD2R3Q61rX5OF/f++W0XtNwHQubzmj8HD/cFneShIQsbl9KgYXoR6HiXcbBiNdmmZjSrzkPYh7vlsujYrz6Cg2msKybWJ/FfOz0tS1cjlCtiCMOTExN6tEF8YCp9l+s+5RLe61pgFPy4Snr9pEjuTS5DYliTyZMY2ZZC1clBQtgE8E2qCG1QSzqnqqiGxj2K4zmLPpB4y1XpW8e3yk= - diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index d9ed2205..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,30 +0,0 @@ -node ("docker-light") { - def SOURCEDIR = pwd() - try { - stage("Clean up") { - step([$class: 'WsCleanup']) - } - stage("Checkout Code") { - checkout scm - } - stage("Test with Docker") { - echo "${env.ALT_URL}" - def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}" - withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) { - sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosetteapi/docker-csharp" - } - } - slack(true) - } catch (e) { - currentBuild.result = "FAILED" - slack(false) - throw e - } -} - -def slack(boolean success) { - def color = success ? "#00FF00" : "#FF0000" - def status = success ? "SUCCESSFUL" : "FAILED" - def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})" - slackSend(color: color, channel: "#rapid", message: message) -} \ No newline at end of file diff --git a/Jenkinsfile.examples b/Jenkinsfile.examples deleted file mode 100644 index 1b2d92a4..00000000 --- a/Jenkinsfile.examples +++ /dev/null @@ -1,36 +0,0 @@ -node { - def SOURCEDIR = pwd() - def TEST_CONTAINER = 'examples/csharp-test' - def DOCKERFILE_DIR = './rosette_apiExamples/docker' - try { - stage("Clean up") { - step([$class: 'WsCleanup']) - } - stage("Checkout Code") { - checkout scm - } - stage("Build Dockerfile") { - dir ("${DOCKERFILE_DIR}") { - sh "docker build --no-cache -t ${TEST_CONTAINER} ." - } - } - stage("Run Examples") { - echo "${env.ALT_URL}" - def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}" - withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) { sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source ${TEST_CONTAINER}" - } - } - slack(true) - } catch (e) { - currentBuild.result = "FAILED" - slack(false) - throw e - } -} - -def slack(boolean success) { - def color = success ? "#00FF00" : "#FF0000" - def status = success ? "SUCCESSFUL" : "FAILED" - def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})" - slackSend(color: color, channel: "#rapid", message: message) -} \ No newline at end of file diff --git a/rosette_api.sln b/rosette_api.sln index 5a508d5a..4e94dcc5 100644 --- a/rosette_api.sln +++ b/rosette_api.sln @@ -1,35 +1,31 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "rosette_api", "rosette_api\rosette_api.csproj", "{D719A8A7-C5C7-49CF-BFFC-523D605E5E37}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "rosette_apiUnitTests", "rosette_apiUnitTests\rosette_apiUnitTests.csproj", "{10EAD22C-041F-4436-A391-935897309C23}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{F17AACDD-48B8-43EA-BF0C-0129592B2BC9}" - ProjectSection(SolutionItems) = preProject - .nuget\packages.config = .nuget\packages.config - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2F9FBE70-5FE8-4A79-96B1-E504266A3CE1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D719A8A7-C5C7-49CF-BFFC-523D605E5E37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D719A8A7-C5C7-49CF-BFFC-523D605E5E37}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D719A8A7-C5C7-49CF-BFFC-523D605E5E37}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D719A8A7-C5C7-49CF-BFFC-523D605E5E37}.Release|Any CPU.Build.0 = Release|Any CPU - {10EAD22C-041F-4436-A391-935897309C23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {10EAD22C-041F-4436-A391-935897309C23}.Debug|Any CPU.Build.0 = Debug|Any CPU - {10EAD22C-041F-4436-A391-935897309C23}.Release|Any CPU.ActiveCfg = Release|Any CPU - {10EAD22C-041F-4436-A391-935897309C23}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29728.190 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "rosette_api", "rosette_api\rosette_api.csproj", "{7305ECAA-8C0E-473B-8601-5A0F46D7FBE7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "rosette_apiUnitTests", "rosette_apiUnitTests\rosette_apiUnitTests.csproj", "{3907DA8F-E719-4DDF-80C9-47CD0B7ADEA1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7305ECAA-8C0E-473B-8601-5A0F46D7FBE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7305ECAA-8C0E-473B-8601-5A0F46D7FBE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7305ECAA-8C0E-473B-8601-5A0F46D7FBE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7305ECAA-8C0E-473B-8601-5A0F46D7FBE7}.Release|Any CPU.Build.0 = Release|Any CPU + {3907DA8F-E719-4DDF-80C9-47CD0B7ADEA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3907DA8F-E719-4DDF-80C9-47CD0B7ADEA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3907DA8F-E719-4DDF-80C9-47CD0B7ADEA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3907DA8F-E719-4DDF-80C9-47CD0B7ADEA1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A082B23A-401A-4BFA-9D64-897BE471EC6C} + EndGlobalSection +EndGlobal diff --git a/rosette_api/IEnumerableExpanderContractResolver.cs b/rosette_api/IEnumerableExpanderContractResolver.cs deleted file mode 100644 index adc40489..00000000 --- a/rosette_api/IEnumerableExpanderContractResolver.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using Newtonsoft.Json.Linq; -using System.Reflection; - -namespace rosette_api -{ - internal class IEnumerableExpanderContractResolver : IContractResolver - { - public new static readonly ConditionalContractResolver Instance = new ConditionalContractResolver(); - - protected override IList CreateProperties(Type type, MemberSerialization memberSerialization) - { - IList property = base.CreateProperties(typeof(T), memberSerialization); - return property; - } - - public JsonContract ResolveContract(Type type) - { - return new JsonArrayContract(type).ItemConverter.; - } - } -} diff --git a/rosette_api/Properties/AssemblyInfo.cs b/rosette_api/Properties/AssemblyInfo.cs deleted file mode 100644 index 034dbf45..00000000 --- a/rosette_api/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Rosette API C# Binding")] -[assembly: AssemblyDescription("Provides a C# interface to the Rosette API web service")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Basis Technology")] -[assembly: AssemblyProduct("CSharp Binding")] -[assembly: AssemblyCopyright("Copyright © Basis Technology 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("620cf3eb-35fa-4c7a-a659-676b9e4a1b51")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.14.3.0")] -[assembly: AssemblyVersion("1.14.3.0")] -[assembly: AssemblyFileVersion("1.14.3.0")] diff --git a/rosette_api/Properties/Resources.Designer.cs b/rosette_api/Properties/Resources.Designer.cs deleted file mode 100644 index c09ad37f..00000000 --- a/rosette_api/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace rosette_api.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("rosette_api.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/rosette_api/Properties/Resources.resx b/rosette_api/Properties/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/rosette_api/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/rosette_api/Properties/Settings.Designer.cs b/rosette_api/Properties/Settings.Designer.cs deleted file mode 100644 index 943d70e6..00000000 --- a/rosette_api/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace rosette_api.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/rosette_api/Properties/Settings.settings b/rosette_api/Properties/Settings.settings deleted file mode 100644 index 39645652..00000000 --- a/rosette_api/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/rosette_api/app.config b/rosette_api/app.config deleted file mode 100644 index 51278a45..00000000 --- a/rosette_api/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/rosette_api/packages.config b/rosette_api/packages.config deleted file mode 100755 index 9517ce02..00000000 --- a/rosette_api/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/rosette_api/rosette_api.csproj b/rosette_api/rosette_api.csproj index da63c045..4170df1a 100644 --- a/rosette_api/rosette_api.csproj +++ b/rosette_api/rosette_api.csproj @@ -1,124 +1,22 @@ - - - + + - Debug - AnyCPU - {D719A8A7-C5C7-49CF-BFFC-523D605E5E37} - Library - Properties - rosette_api - rosette_api - v4.5 - 512 - - - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - bin\Debug\rosette_api.XML - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - + netstandard2.0 + Basis Technology + C# bindings for Rosette API + Provides a C# interface to the Rosette API web service + 1.14.3 + true + rosette_api_netstandard2 + Basis Technology + - - ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - Designer - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - + - - + \ No newline at end of file diff --git a/rosette_apiUnitTests/Properties/AssemblyInfo.cs b/rosette_apiUnitTests/Properties/AssemblyInfo.cs deleted file mode 100644 index a4eef44b..00000000 --- a/rosette_apiUnitTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Rosette API Unit Tests")] -[assembly: AssemblyDescription("Provides testing for the Rosette API C# Binding")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Basis Technology")] -[assembly: AssemblyProduct("Rosette API")] -[assembly: AssemblyCopyright("2016 Basis Technology Corp")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("02d49180-2983-4cda-84f6-dc3ce79efe00")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/rosette_apiUnitTests/app.config b/rosette_apiUnitTests/app.config deleted file mode 100755 index 7c63cadb..00000000 --- a/rosette_apiUnitTests/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/rosette_apiUnitTests/packages.config b/rosette_apiUnitTests/packages.config deleted file mode 100755 index 9a6be9c5..00000000 --- a/rosette_apiUnitTests/packages.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/rosette_apiUnitTests/rosette_apiUnitTests.cs b/rosette_apiUnitTests/rosette_apiUnitTests.cs index 6467db50..7797035f 100755 --- a/rosette_apiUnitTests/rosette_apiUnitTests.cs +++ b/rosette_apiUnitTests/rosette_apiUnitTests.cs @@ -9,7 +9,6 @@ using System.Linq; using System.Net; using System.Net.Http; -using System.Web.Script.Serialization; using Newtonsoft.Json; using System.Threading.Tasks; @@ -479,8 +478,8 @@ public void InfoTestFull() { "buildNumber", buildNumber }, { "buildTime", buildTime } }; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); - HttpResponseMessage mockedMessage = MakeMockedMessage(responseHeaders, HttpStatusCode.OK, new JavaScriptSerializer().Serialize(content)); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); + HttpResponseMessage mockedMessage = MakeMockedMessage(responseHeaders, HttpStatusCode.OK, JsonConvert.SerializeObject(content)); _mockHttp.When(_testUrl + "info").Respond(req => mockedMessage); InfoResponse expected = new InfoResponse(name, version, buildNumber, buildTime, responseHeaders, content); InfoResponse response = _rosetteApi.Info(); @@ -530,8 +529,8 @@ public void PingTestFull() { { "message", message }, { "time", time } }; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); - HttpResponseMessage mockedMessage = MakeMockedMessage(responseHeaders, HttpStatusCode.OK, new JavaScriptSerializer().Serialize(content)); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); + HttpResponseMessage mockedMessage = MakeMockedMessage(responseHeaders, HttpStatusCode.OK, JsonConvert.SerializeObject(content)); _mockHttp.When(_testUrl + "ping").Respond(req => mockedMessage); PingResponse expected = new PingResponse(message, time, responseHeaders, content); PingResponse response = _rosetteApi.Ping(); @@ -594,7 +593,7 @@ public void AddressSimilarityTestFull() Init(); double score = (double)0.9486632809417912; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "score", score } }; @@ -695,7 +694,7 @@ public void EntityTestFull() RosetteEntity e2 = new RosetteEntity("Dan Akroyd", "Dan Akroyd", new EntityID("Q105221"), "PERSON", 2, 0.99, "X1", null, new List() { new MentionOffset(0, 10), new MentionOffset(20, 32) }, .99, 0.0, null); List entities = new List() { e0, e1, e2 }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "entities", entities } }; @@ -733,7 +732,7 @@ public void EntityTestExtendedProperties() { Dictionary content = new Dictionary { { "entities", entities } }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); EntitiesResponse expected = new EntitiesResponse(entities, responseHeaders, content, null); String mockedContent = expected.ContentToString(); @@ -822,7 +821,7 @@ public void LanguageTestFull() LanguageDetection lang8 = new LanguageDetection("fra", (decimal)0.023298946617300347); List languageDetections = new List() { lang0, lang1, lang2, lang3, lang4, lang5, lang6, lang7, lang8 }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "languageDetections", languageDetections } }; @@ -881,7 +880,7 @@ public void MorphologyTestFullComplete() MorphologyItem m5 = new MorphologyItem(".", "PUNCT", ".", new List(), new List()); List morphology = new List() { m0, m1, m2, m3, m4, m5 }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "tokens", new List(morphology.Select((item) => item.Token)) }, { "posTags", new List(morphology.Select((item) => item.PosTag)) }, @@ -909,7 +908,7 @@ public void MorphologyTestFullLemmas() MorphologyItem m5 = new MorphologyItem(".", null, ".", null, null); List morphology = new List() { m0, m1, m2, m3, m4, m5 }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "tokens", new List(morphology.Select((item) => item.Token)) } }; @@ -932,7 +931,7 @@ public void MorphologyTestFullCompoundComponents() MorphologyItem m1 = new MorphologyItem("Rechtsschutzversicherungsgesellschaft", null, null, compoundComponents, null); List morphology = new List() { m0, m1 }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "tokens", new List(morphology.Select((item) => item.Token)) } }; @@ -958,7 +957,7 @@ public void MorphologyTestFullHanReadings() MorphologyItem m2 = new MorphologyItem("主任", null, null, null, h2); List morphology = new List() { m0, m1, m2 }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "tokens", new List(morphology.Select((item) => item.Token)) } }; @@ -1013,7 +1012,7 @@ public void NameSimilarityTestFull() Init(); double score = (double)0.9486632809417912; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "score", score } }; @@ -1133,7 +1132,7 @@ public void RelationshipsTestFull() List locatives = new List() {loc1}; HashSet modalities = new HashSet() {"assertion", "someOtherModality"}; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); List relationships = new List() { new RosetteRelationship(predicate, new Dictionary() {{1, arg1}}, new Dictionary() {{1, arg1ID}}, null, locatives, null, confidence, modalities) }; @@ -1159,7 +1158,7 @@ public void RelationshipsTestFullNoArgID() List locatives = new List() { loc1 }; HashSet modalities = new HashSet() { "assertion", "someOtherModality" }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); List relationships = new List() { new RosetteRelationship(predicate, new Dictionary() {{1, arg1}}, new Dictionary(), null, locatives, null, confidence, modalities) }; @@ -1231,7 +1230,7 @@ public void SemanticVectorsTestFull() Init(); List vector = new List() {0.02164695, 0.0032850206, 0.0038508752, -0.009704393, -0.0016203842}; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "documentEmbedding", vector }, { "tokens", null }, @@ -1291,7 +1290,7 @@ public void SimilarTermsTestFull() {"eng", new List() {new SimilarTerm("spy", 1.0m)}} }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary() { {"similarTerms", terms} }; @@ -1351,7 +1350,7 @@ public void SentencesTestFull() string s2 = "As I was walking that ribbon of highway,\nI saw above me that endless skyway:\nI saw below me that golden valley:\nThis land was made for you and me."; List sentences = new List() { s0, s1, s2 }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "sentences", sentences } }; @@ -1407,7 +1406,7 @@ public void SentimentTestFull() RosetteSentimentEntity e1 = new RosetteSentimentEntity("The Hollywood Reporter", "The Hollywood Reporter", new EntityID("Q61503"), "ORGANIZATION", 1, docSentiment, (double)0.5338094035254866, null, null, new List() { new MentionOffset(15, 18) }, null, null, null); List entities = new List() { e0, e1 }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "document", docSentiment }, { "entities", entities } @@ -1468,7 +1467,7 @@ public void SyntaxDependenciesTestFull() List sentences = new List() { sentence }; List tokens = new List() { "Sony", "Pictures", "is", "planning", "."}; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "sentences", sentences }, { "tokens", tokens } @@ -1532,7 +1531,7 @@ public void TokensTestFull() "会议" }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "tokens", tokens } }; @@ -1589,7 +1588,7 @@ public void NameTranslationTestFull() string targetScheme = "IC"; double confidence = (double)0.06856099342585828; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "translation", translation }, { "targetLanguage", targetLanguage }, @@ -1655,7 +1654,7 @@ public void TopicsTestFull() { new KeyPhrase("Nicholas Hoult", null) }; string headersAsString = " { \"Content-Type\": \"application/json\", \"Date\": \"Thu, 11 Aug 2016 15:47:32 GMT\", \"Server\": \"openresty\", \"Strict-Transport-Security\": \"max-age=63072000; includeSubdomains; preload\", \"x-rosetteapi-app-id\": \"1409611723442\", \"x-rosetteapi-concurrency\": \"50\", \"x-rosetteapi-request-id\": \"d4176692-4f14-42d7-8c26-4b2d8f7ff049\", \"Content-Length\": \"72\", \"Connection\": \"Close\" }"; - Dictionary responseHeaders = new JavaScriptSerializer().Deserialize>(headersAsString); + Dictionary responseHeaders = JsonConvert.DeserializeObject>(headersAsString); Dictionary content = new Dictionary { { "concepts", concepts }, { "keyphrases", keyPhrases } diff --git a/rosette_apiUnitTests/rosette_apiUnitTests.csproj b/rosette_apiUnitTests/rosette_apiUnitTests.csproj index d3c8bd7c..5a177886 100644 --- a/rosette_apiUnitTests/rosette_apiUnitTests.csproj +++ b/rosette_apiUnitTests/rosette_apiUnitTests.csproj @@ -1,150 +1,24 @@ - - - + + - Debug - AnyCPU - {10EAD22C-041F-4436-A391-935897309C23} - Library - Properties - rosette_apiUnitTests - rosette_apiUnitTests - v4.5.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - + netcoreapp3.1 + + false + - - ..\packages\LinqToExcel.1.11.0\lib\LinqToExcel.dll - - - ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll - - - ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll - - - ..\packages\LinqToExcel.1.11.0\lib\Remotion.dll - - - ..\packages\LinqToExcel.1.11.0\lib\Remotion.Data.Linq.dll - - - ..\packages\LinqToExcel.1.11.0\lib\Remotion.Interfaces.dll - - - ..\packages\RichardSzalay.MockHttp.3.2.1\lib\net45\RichardSzalay.MockHttp.dll - - - - 3.5 - - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll - - - - + + + + - - - - - - - - + - - + + - - {d719a8a7-c5c7-49cf-bffc-523d605e5e37} - rosette_api - + - - - Designer - - - - - - - - False - - - False - - - False - - - False - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - + \ No newline at end of file From 06fdef859f5bd772ad0f47bfe229178718a83941 Mon Sep 17 00:00:00 2001 From: Seth Gransky Date: Wed, 15 Apr 2020 15:10:14 -0500 Subject: [PATCH 3/5] BT-14481: Revert changes causing PR conflicts. --- .travis.yml | 3 --- rosette_api/rosette_api.csproj | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77c12741..501832e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,9 @@ language: csharp -mono: none -dotnet: 2.1.502 install: - nuget restore rosette_api.sln script: - - dotnet restore - xbuild /p:Configuration=Release rosette_api.sln - mono ./packages/NUnit.Console.3.0.1/tools/nunit3-console.exe ./rosette_apiUnitTests/bin/Release/rosette_apiUnitTests.dll diff --git a/rosette_api/rosette_api.csproj b/rosette_api/rosette_api.csproj index 1d643044..4faca089 100644 --- a/rosette_api/rosette_api.csproj +++ b/rosette_api/rosette_api.csproj @@ -9,7 +9,7 @@ Properties rosette_api rosette_api - netstandard2.0 + v4.5 512 @@ -121,4 +121,4 @@ --> - \ No newline at end of file + From 8d3da9b9109ef3b880bf037271918ee1460ee29d Mon Sep 17 00:00:00 2001 From: Seth Gransky Date: Wed, 15 Apr 2020 15:11:00 -0500 Subject: [PATCH 4/5] BT-14481: Revert changes causing PR conflicts. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 501832e4..e3a6a409 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,4 @@ notifications: - secure: 4FRaTAAiYyeUvgw2RhmblgbNiJO4wmd34OBgWcwURjP9oVmFfSwR9r1LNCdUGxrPOghexSY2DjXIuvIrfTfi/xYbhHb3Kw7PEAyB8IuBMlKtY4NSFou62S2VhYpxyg58T+C7P2zi0eDnDE06pwTCoGPaimxMZQY91yQ0yPYDPVXbwe5SjEgamzlwGBxlS/0A6w1iCPHg27/iO2hXtdW3oLS2I0F/Q8Q95RBkX9hpg6yqHlTV7jRbSqvQ9OFBqk/tXMHQvhoPDGgCgQDuykJuaAYx7g9d0YL0eEYYOh9B/TJ/kNOwdRFBu5kuQ2/nFS5Z0S3Y3UIhdYjUmm9gSMnwIbYnrW22EqDJLoT9Zi3Gv7Prg/8/fSkWsof7BJTMSuXUqO1AxDGKIxFv9uSF1daZoY+AC1ooU1xDu1nNvWVYPlkwEdDxxmHpFkGT3ESTZYccPovQl8Z5K0I1BBAVdJKDzm07lE6VHbxkKcvK6gG0TN3uLxnSlQtjkfJ+aVMq1kxeVsB9lEsKs9oezsKzzbftMm525aXPg+OAv+31CUFWxvT/p4ps8Q+AV6aZpoPHkpK8VryyNirUeZ/m4m4ebDHhD9vcN+JqE9g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kaSoZVSpGduNnCst8h6MpgauPtrgwHk4zGMoSl+L6al+nFo/3h2dXeebrQ0tY/hRfZi4Q8xwqG9083TBqi71fTpoFZ7sNtrY4Kdtl5Oa2CFUo7lVn1JB9qQwSa0eai3Whv0RyRqqQe77aDUj0dfD2R3Q61rX5OF/f++W0XtNwHQubzmj8HD/cFneShIQsbl9KgYXoR6HiXcbBiNdmmZjSrzkPYh7vlsujYrz6Cg2msKybWJ/FfOz0tS1cjlCtiCMOTExN6tEF8YCp9l+s+5RLe61pgFPy4Snr9pEjuTS5DYliTyZMY2ZZC1clBQtgE8E2qCG1QSzqnqqiGxj2K4zmLPpB4y1XpW8e3yk= + From 5b921c4b1278e91c93757bf9532814c187cc55d1 Mon Sep 17 00:00:00 2001 From: Seth Gransky Date: Wed, 15 Apr 2020 15:14:50 -0500 Subject: [PATCH 5/5] BT-14481: Revert changes causing PR conflicts. --- rosette_api/rosette_api.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rosette_api/rosette_api.csproj b/rosette_api/rosette_api.csproj index 4faca089..da63c045 100644 --- a/rosette_api/rosette_api.csproj +++ b/rosette_api/rosette_api.csproj @@ -121,4 +121,4 @@ --> - + \ No newline at end of file