Skip to content

Commit 428e664

Browse files
committed
Add gitattributes and fix line-endings
See folks. THIS IS WHY WE ALWAYS ADD A .gitattributes FILE!
1 parent a3c903b commit 428e664

20 files changed

+1942
-1920
lines changed

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

RestSharp.Mono.sln

+52-52
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 11.00
3-
# Visual Studio 2010
4-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp", "RestSharp\RestSharp.csproj", "{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}"
5-
EndProject
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp.Tests", "RestSharp.Tests\RestSharp.Tests.csproj", "{1464E4AC-18BB-4F23-8A0B-68196F9E1871}"
7-
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{E709A928-A45C-4622-A35C-CCD8EE44CA80}"
9-
ProjectSection(SolutionItems) = preProject
10-
restsharp.nuspec = restsharp.nuspec
11-
EndProjectSection
12-
EndProject
13-
Global
14-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15-
Debug|Any CPU = Debug|Any CPU
16-
Debug|Mixed Platforms = Debug|Mixed Platforms
17-
Debug|x86 = Debug|x86
18-
Release|Any CPU = Release|Any CPU
19-
Release|Mixed Platforms = Release|Mixed Platforms
20-
Release|x86 = Release|x86
21-
EndGlobalSection
22-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
23-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.Build.0 = Debug|Any CPU
25-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
26-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
27-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|x86.ActiveCfg = Debug|Any CPU
28-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.ActiveCfg = Release|Any CPU
29-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.Build.0 = Release|Any CPU
30-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
31-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.Build.0 = Release|Any CPU
32-
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|x86.ActiveCfg = Release|Any CPU
33-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
35-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
36-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
37-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|x86.ActiveCfg = Debug|Any CPU
38-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
39-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.Build.0 = Release|Any CPU
40-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
41-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
42-
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|x86.ActiveCfg = Release|Any CPU
43-
EndGlobalSection
44-
GlobalSection(NestedProjects) = preSolution
45-
EndGlobalSection
46-
GlobalSection(MonoDevelopProperties) = preSolution
47-
StartupItem = RestSharp\RestSharp.csproj
48-
EndGlobalSection
49-
GlobalSection(SolutionProperties) = preSolution
50-
HideSolutionNode = FALSE
51-
EndGlobalSection
52-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp", "RestSharp\RestSharp.csproj", "{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}"
5+
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp.Tests", "RestSharp.Tests\RestSharp.Tests.csproj", "{1464E4AC-18BB-4F23-8A0B-68196F9E1871}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{E709A928-A45C-4622-A35C-CCD8EE44CA80}"
9+
ProjectSection(SolutionItems) = preProject
10+
restsharp.nuspec = restsharp.nuspec
11+
EndProjectSection
12+
EndProject
13+
Global
14+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15+
Debug|Any CPU = Debug|Any CPU
16+
Debug|Mixed Platforms = Debug|Mixed Platforms
17+
Debug|x86 = Debug|x86
18+
Release|Any CPU = Release|Any CPU
19+
Release|Mixed Platforms = Release|Mixed Platforms
20+
Release|x86 = Release|x86
21+
EndGlobalSection
22+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
23+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.Build.0 = Debug|Any CPU
25+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
26+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
27+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|x86.ActiveCfg = Debug|Any CPU
28+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.Build.0 = Release|Any CPU
30+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
31+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.Build.0 = Release|Any CPU
32+
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|x86.ActiveCfg = Release|Any CPU
33+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
36+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
37+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|x86.ActiveCfg = Debug|Any CPU
38+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
41+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
42+
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|x86.ActiveCfg = Release|Any CPU
43+
EndGlobalSection
44+
GlobalSection(NestedProjects) = preSolution
45+
EndGlobalSection
46+
GlobalSection(MonoDevelopProperties) = preSolution
47+
StartupItem = RestSharp\RestSharp.csproj
48+
EndGlobalSection
49+
GlobalSection(SolutionProperties) = preSolution
50+
HideSolutionNode = FALSE
51+
EndGlobalSection
52+
EndGlobal

RestSharp.Tests/JsonTests.cs

+34-34
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,19 @@ public void Can_Deserialize_Null_Elements_to_Nullable_Values()
170170
Assert.Null(output.Id);
171171
Assert.Null(output.StartDate);
172172
Assert.Null(output.UniqueId);
173-
}
174-
175-
[Fact]
176-
public void Can_Deserialize_Empty_Elements_to_Nullable_Values()
177-
{
178-
var doc = CreateJsonWithEmptyValues();
179-
180-
var json = new JsonDeserializer();
181-
var output = json.Deserialize<NullableValues>(new RestResponse { Content = doc });
182-
183-
Assert.Null(output.Id);
184-
Assert.Null(output.StartDate);
185-
Assert.Null(output.UniqueId);
173+
}
174+
175+
[Fact]
176+
public void Can_Deserialize_Empty_Elements_to_Nullable_Values()
177+
{
178+
var doc = CreateJsonWithEmptyValues();
179+
180+
var json = new JsonDeserializer();
181+
var output = json.Deserialize<NullableValues>(new RestResponse { Content = doc });
182+
183+
Assert.Null(output.Id);
184+
Assert.Null(output.StartDate);
185+
Assert.Null(output.UniqueId);
186186
}
187187

188188
[Fact]
@@ -632,17 +632,17 @@ public void Can_Deserialize_To_Dictionary_String_String_With_Dynamic_Values ()
632632
Assert.Equal ("{\"Name\":\"ThingBlue\",\"Color\":\"Blue\"}", bd["ThingBlue"]);
633633
}
634634

635-
[Fact]
636-
public void Can_Deserialize_Decimal_With_Four_Zeros_After_Floating_Point()
637-
{
638-
const string json = "{\"Value\":0.00005557}";
639-
var response = new RestResponse() {Content = json};
640-
var d = new JsonDeserializer();
641-
var result = d.Deserialize<DecimalNumber>(response);
642-
643-
Assert.Equal(result.Value, .00005557m);
644-
}
645-
635+
[Fact]
636+
public void Can_Deserialize_Decimal_With_Four_Zeros_After_Floating_Point()
637+
{
638+
const string json = "{\"Value\":0.00005557}";
639+
var response = new RestResponse() {Content = json};
640+
var d = new JsonDeserializer();
641+
var result = d.Deserialize<DecimalNumber>(response);
642+
643+
Assert.Equal(result.Value, .00005557m);
644+
}
645+
646646
[Fact]
647647
public void Can_Deserialize_Object_Type_Property_With_Primitive_Vale()
648648
{
@@ -801,16 +801,16 @@ private string CreateJsonWithNullValues()
801801
doc["UniqueId"] = null;
802802

803803
return doc.ToString();
804-
}
805-
806-
private string CreateJsonWithEmptyValues()
807-
{
808-
var doc = new JsonObject();
809-
doc["Id"] = "";
810-
doc["StartDate"] = "";
811-
doc["UniqueId"] = "";
812-
813-
return doc.ToString();
804+
}
805+
806+
private string CreateJsonWithEmptyValues()
807+
{
808+
var doc = new JsonObject();
809+
doc["Id"] = "";
810+
doc["StartDate"] = "";
811+
doc["UniqueId"] = "";
812+
813+
return doc.ToString();
814814
}
815815

816816
private string CreateJsonWithoutEmptyValues()

RestSharp.Tests/NamespacedXmlTests.cs

+23-23
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
// limitations under the License.
1515
#endregion
1616

17-
using System;
18-
using System.Collections.Generic;
17+
using System;
18+
using System.Collections.Generic;
1919
using System.Xml.Linq;
20-
using RestSharp.Deserializers;
21-
using RestSharp.Tests.SampleClasses.Lastfm;
20+
using RestSharp.Deserializers;
21+
using RestSharp.Tests.SampleClasses.Lastfm;
2222
using Xunit;
2323

2424
namespace RestSharp.Tests
@@ -161,27 +161,27 @@ public void Can_Deserialize_Names_With_Underscores_With_Namespace() {
161161
}
162162

163163
[Fact]
164-
public void Can_Deserialize_List_Of_Primitives_With_Namespace() {
165-
var doc = CreateListOfPrimitivesXml();
166-
var response = new RestResponse { Content = doc };
167-
168-
var d = new XmlDeserializer();
169-
d.Namespace = "http://restsharp.org";
170-
var a = d.Deserialize<List<artist>>(response);
171-
172-
Assert.Equal(2, a.Count);
173-
Assert.Equal("first", a[0].Value);
174-
Assert.Equal("second", a[1].Value);
164+
public void Can_Deserialize_List_Of_Primitives_With_Namespace() {
165+
var doc = CreateListOfPrimitivesXml();
166+
var response = new RestResponse { Content = doc };
167+
168+
var d = new XmlDeserializer();
169+
d.Namespace = "http://restsharp.org";
170+
var a = d.Deserialize<List<artist>>(response);
171+
172+
Assert.Equal(2, a.Count);
173+
Assert.Equal("first", a[0].Value);
174+
Assert.Equal("second", a[1].Value);
175175
}
176176

177-
private static string CreateListOfPrimitivesXml() {
178-
var doc = new XDocument();
179-
var ns = XNamespace.Get("http://restsharp.org");
180-
var root = new XElement(ns + "artists");
181-
root.Add(new XElement(ns + "artist", "first"));
182-
root.Add(new XElement(ns + "artist", "second"));
183-
doc.Add(root);
184-
return doc.ToString();
177+
private static string CreateListOfPrimitivesXml() {
178+
var doc = new XDocument();
179+
var ns = XNamespace.Get("http://restsharp.org");
180+
var root = new XElement(ns + "artists");
181+
root.Add(new XElement(ns + "artist", "first"));
182+
root.Add(new XElement(ns + "artist", "second"));
183+
doc.Add(root);
184+
return doc.ToString();
185185
}
186186

187187
private static string CreateUnderscoresXml() {

0 commit comments

Comments
 (0)