-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verify NS.JSon is loaded appropriately in case of DisableAppDomain (#…
…1740) * reverting back app domain culture setup * binding redirect for TW.Interfaces * Run net451 test for Newtonsoft dependency
- Loading branch information
1 parent
ad34f47
commit 3cbab0b
Showing
5 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
34 changes: 34 additions & 0 deletions
34
test/TestAssets/NewtonSoftDependency/NewtonSoftDependency.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<!-- Package dependency versions --> | ||
<PropertyGroup> | ||
<TestPlatformRoot Condition="$(TestPlatformRoot) == ''">..\..\..\</TestPlatformRoot> | ||
<TestProject>true</TestProject> | ||
</PropertyGroup> | ||
<!-- Imports Common TestAssets props. --> | ||
<Import Project="..\..\..\scripts\build\TestAssets.props" /> | ||
<Import Project="..\..\..\scripts\build\TestPlatform.Dependencies.props" /> | ||
<PropertyGroup> | ||
<AssemblyName>NewtonSoftDependency</AssemblyName> | ||
<TargetFrameworks>net451</TargetFrameworks> | ||
<OutputType Condition="$(NetCoreAppTargetFrameWork) == 'true' ">Exe</OutputType> | ||
</PropertyGroup> | ||
|
||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' "> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Runtime" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
</ItemGroup> | ||
|
||
|
||
<ItemGroup> | ||
<PackageReference Include="MSTest.TestAdapter" Version="$(MSTestAdapterVersion)" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestAdapterVersion)" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
namespace NewtonSoftDependency | ||
{ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Newtonsoft.Json; | ||
|
||
public class Account | ||
{ | ||
public string Email { get; set; } | ||
public bool Active { get; set; } | ||
} | ||
|
||
[TestClass] | ||
public class UnitTest1 | ||
{ | ||
[TestMethod] | ||
public void TestMethod1() | ||
{ | ||
string json = @"{'Email': 'john@example.com', 'Active': true}"; | ||
|
||
Account account = JsonConvert.DeserializeObject<Account>(json); | ||
|
||
Assert.AreEqual("john@example.com", account.Email); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters