Skip to content

Commit

Permalink
Add gitattributes and fix line-endings
Browse files Browse the repository at this point in the history
See folks. THIS IS WHY WE ALWAYS ADD A .gitattributes FILE!
  • Loading branch information
haacked committed Sep 7, 2013
1 parent a3c903b commit 428e664
Show file tree
Hide file tree
Showing 20 changed files with 1,942 additions and 1,920 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
104 changes: 52 additions & 52 deletions RestSharp.Mono.sln
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp", "RestSharp\RestSharp.csproj", "{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp.Tests", "RestSharp.Tests\RestSharp.Tests.csproj", "{1464E4AC-18BB-4F23-8A0B-68196F9E1871}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{E709A928-A45C-4622-A35C-CCD8EE44CA80}"
ProjectSection(SolutionItems) = preProject
restsharp.nuspec = restsharp.nuspec
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|x86.ActiveCfg = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.Build.0 = Release|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|x86.ActiveCfg = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|x86.ActiveCfg = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.Build.0 = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = RestSharp\RestSharp.csproj
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp", "RestSharp\RestSharp.csproj", "{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RestSharp.Tests", "RestSharp.Tests\RestSharp.Tests.csproj", "{1464E4AC-18BB-4F23-8A0B-68196F9E1871}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{E709A928-A45C-4622-A35C-CCD8EE44CA80}"
ProjectSection(SolutionItems) = preProject
restsharp.nuspec = restsharp.nuspec
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Debug|x86.ActiveCfg = Debug|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Any CPU.Build.0 = Release|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{1464E4AC-18BB-4F23-8A0B-68196F9E1871}.Release|x86.ActiveCfg = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Debug|x86.ActiveCfg = Debug|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Any CPU.Build.0 = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2ECECFBF-5F3E-40EE-A963-72336DC7ABE2}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = RestSharp\RestSharp.csproj
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
68 changes: 34 additions & 34 deletions RestSharp.Tests/JsonTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,19 @@ public void Can_Deserialize_Null_Elements_to_Nullable_Values()
Assert.Null(output.Id);
Assert.Null(output.StartDate);
Assert.Null(output.UniqueId);
}

[Fact]
public void Can_Deserialize_Empty_Elements_to_Nullable_Values()
{
var doc = CreateJsonWithEmptyValues();

var json = new JsonDeserializer();
var output = json.Deserialize<NullableValues>(new RestResponse { Content = doc });

Assert.Null(output.Id);
Assert.Null(output.StartDate);
Assert.Null(output.UniqueId);
}

[Fact]
public void Can_Deserialize_Empty_Elements_to_Nullable_Values()
{
var doc = CreateJsonWithEmptyValues();

var json = new JsonDeserializer();
var output = json.Deserialize<NullableValues>(new RestResponse { Content = doc });

Assert.Null(output.Id);
Assert.Null(output.StartDate);
Assert.Null(output.UniqueId);
}

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

[Fact]
public void Can_Deserialize_Decimal_With_Four_Zeros_After_Floating_Point()
{
const string json = "{\"Value\":0.00005557}";
var response = new RestResponse() {Content = json};
var d = new JsonDeserializer();
var result = d.Deserialize<DecimalNumber>(response);

Assert.Equal(result.Value, .00005557m);
}

[Fact]
public void Can_Deserialize_Decimal_With_Four_Zeros_After_Floating_Point()
{
const string json = "{\"Value\":0.00005557}";
var response = new RestResponse() {Content = json};
var d = new JsonDeserializer();
var result = d.Deserialize<DecimalNumber>(response);

Assert.Equal(result.Value, .00005557m);
}

[Fact]
public void Can_Deserialize_Object_Type_Property_With_Primitive_Vale()
{
Expand Down Expand Up @@ -801,16 +801,16 @@ private string CreateJsonWithNullValues()
doc["UniqueId"] = null;

return doc.ToString();
}

private string CreateJsonWithEmptyValues()
{
var doc = new JsonObject();
doc["Id"] = "";
doc["StartDate"] = "";
doc["UniqueId"] = "";

return doc.ToString();
}

private string CreateJsonWithEmptyValues()
{
var doc = new JsonObject();
doc["Id"] = "";
doc["StartDate"] = "";
doc["UniqueId"] = "";

return doc.ToString();
}

private string CreateJsonWithoutEmptyValues()
Expand Down
46 changes: 23 additions & 23 deletions RestSharp.Tests/NamespacedXmlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
// limitations under the License.
#endregion

using System;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using RestSharp.Deserializers;
using RestSharp.Tests.SampleClasses.Lastfm;
using RestSharp.Deserializers;
using RestSharp.Tests.SampleClasses.Lastfm;
using Xunit;

namespace RestSharp.Tests
Expand Down Expand Up @@ -161,27 +161,27 @@ public void Can_Deserialize_Names_With_Underscores_With_Namespace() {
}

[Fact]
public void Can_Deserialize_List_Of_Primitives_With_Namespace() {
var doc = CreateListOfPrimitivesXml();
var response = new RestResponse { Content = doc };

var d = new XmlDeserializer();
d.Namespace = "http://restsharp.org";
var a = d.Deserialize<List<artist>>(response);

Assert.Equal(2, a.Count);
Assert.Equal("first", a[0].Value);
Assert.Equal("second", a[1].Value);
public void Can_Deserialize_List_Of_Primitives_With_Namespace() {
var doc = CreateListOfPrimitivesXml();
var response = new RestResponse { Content = doc };

var d = new XmlDeserializer();
d.Namespace = "http://restsharp.org";
var a = d.Deserialize<List<artist>>(response);

Assert.Equal(2, a.Count);
Assert.Equal("first", a[0].Value);
Assert.Equal("second", a[1].Value);
}

private static string CreateListOfPrimitivesXml() {
var doc = new XDocument();
var ns = XNamespace.Get("http://restsharp.org");
var root = new XElement(ns + "artists");
root.Add(new XElement(ns + "artist", "first"));
root.Add(new XElement(ns + "artist", "second"));
doc.Add(root);
return doc.ToString();
private static string CreateListOfPrimitivesXml() {
var doc = new XDocument();
var ns = XNamespace.Get("http://restsharp.org");
var root = new XElement(ns + "artists");
root.Add(new XElement(ns + "artist", "first"));
root.Add(new XElement(ns + "artist", "second"));
doc.Add(root);
return doc.ToString();
}

private static string CreateUnderscoresXml() {
Expand Down
Loading

0 comments on commit 428e664

Please sign in to comment.