Skip to content

Commit 8dc8942

Browse files
committed
Fixing the missing SimpleJson lib
1 parent 29bf7a8 commit 8dc8942

21 files changed

+157
-185
lines changed

netfx.props

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
44
<!-- have to teach MSBuild where the Mono copy of the reference assemblies is -->
5-
<TargetIsMono Condition="$(TargetFramework.StartsWith('net4')) and '$(OS)' == 'Unix'">true</TargetIsMono>
5+
<TargetIsMono Condition="$(TargetFramework.StartsWith('net4')) AND '$(OS)' == 'Unix'">true</TargetIsMono>
66

77
<!-- Look in the standard install locations -->
88
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND '$(TargetIsMono)' == 'true' AND EXISTS('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono</BaseFrameworkPathOverrideForMono>
@@ -23,4 +23,10 @@
2323
<!-- Add the Facades directory. Not sure how else to do this. Necessary at least for .NET 4.5 -->
2424
<AssemblySearchPaths Condition="'$(BaseFrameworkPathOverrideForMono)' != ''">$(FrameworkPathOverride)/Facades;$(AssemblySearchPaths)</AssemblySearchPaths>
2525
</PropertyGroup>
26+
27+
<Target Name="Print" AfterTargets="Build">
28+
<Message Text="OS: $(OS)" Importance="high" />
29+
<Message Text="Is mono: $(TargetIsMono)" Importance="high" />
30+
<Message Text="Target: $(TargetFramework)" Importance="high" />
31+
</Target>
2632
</Project>

src/Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
<ItemGroup>
2424
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
2525
<PackageReference Include="MinVer" Version="2.2.0" PrivateAssets="All"/>
26-
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0"/>
26+
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" PrivateAssets="All"/>
27+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
2728
</ItemGroup>
2829

2930
<ItemGroup>
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
4-
</PropertyGroup>
5-
6-
<ItemGroup>
7-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
8-
</ItemGroup>
9-
10-
<ItemGroup>
11-
<ProjectReference Include="..\RestSharp\RestSharp.csproj" />
12-
</ItemGroup>
13-
2+
<PropertyGroup>
3+
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
7+
</ItemGroup>
8+
<ItemGroup>
9+
<ProjectReference Include="..\RestSharp\RestSharp.csproj"/>
10+
</ItemGroup>
1411
</Project>
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
5-
<IsPackable>false</IsPackable>
6-
<RootNamespace>RestSharp</RootNamespace>
7-
</PropertyGroup>
8-
2+
<PropertyGroup>
3+
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
4+
<IsPackable>false</IsPackable>
5+
<RootNamespace>RestSharp</RootNamespace>
6+
</PropertyGroup>
97
</Project>
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
4-
</PropertyGroup>
5-
6-
<ItemGroup>
7-
<PackageReference Include="System.Text.Json" Version="4.7.0"/>
8-
</ItemGroup>
9-
10-
<ItemGroup>
11-
<ProjectReference Include="..\RestSharp\RestSharp.csproj"/>
12-
</ItemGroup>
13-
2+
<PropertyGroup>
3+
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageReference Include="System.Text.Json" Version="4.7.0"/>
7+
</ItemGroup>
8+
<ItemGroup>
9+
<ProjectReference Include="..\RestSharp\RestSharp.csproj"/>
10+
</ItemGroup>
1411
</Project>
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
4-
</PropertyGroup>
5-
6-
<ItemGroup>
7-
<PackageReference Include="Utf8Json" Version="1.3.7"/>
8-
</ItemGroup>
9-
10-
<ItemGroup>
11-
<ProjectReference Include="..\RestSharp\RestSharp.csproj"/>
12-
</ItemGroup>
13-
2+
<PropertyGroup>
3+
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageReference Include="Utf8Json" Version="1.3.7"/>
7+
</ItemGroup>
8+
<ItemGroup>
9+
<ProjectReference Include="..\RestSharp\RestSharp.csproj"/>
10+
</ItemGroup>
1411
</Project>

src/RestSharp/RestSharp.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="../../netfx.props" />
3-
42
<PropertyGroup>
53
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
4+
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
65
</PropertyGroup>
7-
86
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
97
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
108
</PropertyGroup>
11-
129
<ItemGroup>
13-
<Reference Include="System.Web" Condition="'$(TargetFramework)' == 'net452'" />
10+
<Reference Include="System.Web" Condition="'$(TargetFramework)' == 'net452'"/>
1411
</ItemGroup>
15-
1612
<ItemGroup>
17-
<ProjectReference Include="..\RestSharp.Serializers.SimpleJson\RestSharp.Serializers.SimpleJson.csproj" />
13+
<ProjectReference Include="..\RestSharp.Serializers.SimpleJson\RestSharp.Serializers.SimpleJson.csproj"/>
1814
</ItemGroup>
1915

16+
<Target DependsOnTargets="ResolveReferences" Name="CopyProjectReferencesToPackage">
17+
<ItemGroup>
18+
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))"/>
19+
</ItemGroup>
20+
</Target>
2021
</Project>

test/Directory.Build.props

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project>
2+
<PropertyGroup>
3+
<IsTestProject>true</IsTestProject>
4+
<IsPackable>false</IsPackable>
5+
<AssemblyOriginatorKeyFile>..\..\RestSharp.snk</AssemblyOriginatorKeyFile>
6+
<SignAssembly>true</SignAssembly>
7+
<LangVersion>8</LangVersion>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0"/>
12+
<PackageReference Include="NUnit" Version="3.12.0"/>
13+
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1"/>
14+
<PackageReference Include="AutoFixture" Version="4.11.0"/>
15+
<PackageReference Include="FluentAssertions" Version="5.10.0"/>
16+
<PackageReference Include="coverlet.collector" Version="1.0.1"/>
17+
</ItemGroup>
18+
</Project>

test/RestSharp.IntegrationTests/CustomRequestSerializerTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
using FluentAssertions;
12
using NUnit.Framework;
23
using RestSharp.Serialization.Xml;
34
using RestSharp.Serializers;
45
using RestSharp.Tests.Shared.Fixtures;
5-
using Shouldly;
66

77
namespace RestSharp.IntegrationTests
88
{
@@ -21,7 +21,7 @@ public void Should_use_custom_xml_serializer()
2121
request.AddXmlBody(body);
2222
client.Execute(request);
2323

24-
serializer.BodyString.ShouldBe(body.ToString());
24+
serializer.BodyString.Should().Be(body.ToString());
2525
}
2626

2727
[Test]
@@ -37,7 +37,7 @@ public void Should_use_custom_json_serializer_for_addbody()
3737
request.AddBody(body);
3838
client.Execute(request);
3939

40-
serializer.BodyString.ShouldBe(body.ToString());
40+
serializer.BodyString.Should().Be(body.ToString());
4141
}
4242

4343
[Test]
@@ -53,7 +53,7 @@ public void Should_use_custom_json_serializer()
5353
request.AddJsonBody(body);
5454
client.Execute(request);
5555

56-
serializer.BodyString.ShouldBe(body.ToString());
56+
serializer.BodyString.Should().Be(body.ToString());
5757
}
5858

5959
class CustomXmlSerializer : IXmlSerializer
@@ -77,4 +77,4 @@ class CustomJsonSerializer : ISerializer
7777
public string ContentType { get; set; } = Serialization.ContentType.Json;
7878
}
7979
}
80-
}
80+
}

test/RestSharp.IntegrationTests/DefaultParameterTests.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1+
// Copyright © 2009-2020 John Sheehan, Andrew Young, Alexey Zimarev and RestSharp community
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
116
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
417
using System.Net;
18+
using FluentAssertions;
519
using NUnit.Framework;
620
using RestSharp.Tests.Shared.Fixtures;
7-
using Shouldly;
821

922
namespace RestSharp.IntegrationTests
1023
{
@@ -27,8 +40,8 @@ public void Should_add_default_and_request_query_get_parameters()
2740
client.Get(request);
2841

2942
var query = RequestHandler.Url.Query;
30-
query.ShouldContain("foo=bar");
31-
query.ShouldContain("foo1=bar1");
43+
query.Should().Contain("foo=bar");
44+
query.Should().Contain("foo1=bar1");
3245
}
3346

3447
[Test]
@@ -39,7 +52,7 @@ public void Should_add_default_and_request_url_get_parameters()
3952

4053
client.Get(request);
4154

42-
RequestHandler.Url.Segments.ShouldBe(new[] {"/", "bar/", "bar1"});
55+
RequestHandler.Url.Segments.Should().BeEquivalentTo("/", "bar/", "bar1");
4356
}
4457

4558
[Test]

0 commit comments

Comments
 (0)