From b0cd9ab10216eac3805569caeaf51a5634323474 Mon Sep 17 00:00:00 2001 From: Haacked Date: Tue, 10 Sep 2013 10:37:52 -0700 Subject: [PATCH 1/6] More comment warning suppressions --- RestSharp.Net4/RestSharp.Net4.csproj | 2 +- RestSharp.Silverlight/RestSharp.Silverlight.csproj | 2 +- RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj | 2 +- RestSharp/RestSharp.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RestSharp.Net4/RestSharp.Net4.csproj b/RestSharp.Net4/RestSharp.Net4.csproj index 9f701fd0b..e410f8a4b 100644 --- a/RestSharp.Net4/RestSharp.Net4.csproj +++ b/RestSharp.Net4/RestSharp.Net4.csproj @@ -33,7 +33,7 @@ prompt 4 bin\Release\RestSharp.xml - 1591,1573,1658,1584 + 1591,1573,1658,1584,1574,1572 diff --git a/RestSharp.Silverlight/RestSharp.Silverlight.csproj b/RestSharp.Silverlight/RestSharp.Silverlight.csproj index 2241e5a16..00a39fd4a 100644 --- a/RestSharp.Silverlight/RestSharp.Silverlight.csproj +++ b/RestSharp.Silverlight/RestSharp.Silverlight.csproj @@ -48,7 +48,7 @@ prompt 4 Bin\Release\RestSharp.Silverlight.xml - 1591,1573,1658,1584 + 1591,1573,1658,1584,1574,1572 diff --git a/RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj b/RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj index 986661a3e..b95ccd8f2 100644 --- a/RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj +++ b/RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj @@ -43,7 +43,7 @@ prompt 4 Bin\Release\RestSharp.WindowsPhone.xml - 1591,1573,1658,1584 + 1591,1573,1658,1584,1574,1572 diff --git a/RestSharp/RestSharp.csproj b/RestSharp/RestSharp.csproj index 18fd53ac4..9691237c5 100644 --- a/RestSharp/RestSharp.csproj +++ b/RestSharp/RestSharp.csproj @@ -56,7 +56,7 @@ 4 AllRules.ruleset bin\Release\RestSharp.xml - 1591,1573,1658,1584 + 1591,1573,1658,1584,1574,1572 From 35154c975d31815174d4248b03c7472b01a042e0 Mon Sep 17 00:00:00 2001 From: Haacked Date: Tue, 10 Sep 2013 10:45:22 -0700 Subject: [PATCH 2/6] Fix tests which need to factor in SemVer I don't plan on using crazy semver pre-release versions yet so I made the regex very simple. --- RestSharp.Tests/NuSpecUpdateTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RestSharp.Tests/NuSpecUpdateTask.cs b/RestSharp.Tests/NuSpecUpdateTask.cs index e71403b48..fa9db80e3 100644 --- a/RestSharp.Tests/NuSpecUpdateTask.cs +++ b/RestSharp.Tests/NuSpecUpdateTask.cs @@ -67,7 +67,7 @@ public class WhenSpecFileIsValid : BaseNuSpecUpdateTest private string _expectedDescription = "Simple REST and HTTP API Client"; private string _expectedAuthors = "John Sheehan, RestSharp Community"; private string _expectedOwners = "John Sheehan, RestSharp Community"; - private Regex _expectedVersion = new Regex(@"^\d+\.\d+\.\d+$", RegexOptions.Compiled); + private Regex _expectedVersion = new Regex(@"^\d+\.\d+\.\d+(-\w+)$", RegexOptions.Compiled); protected override void Setup() { From da234191bb70521d717ca81e389accb9b3121378 Mon Sep 17 00:00:00 2001 From: Haacked Date: Tue, 10 Sep 2013 10:46:17 -0700 Subject: [PATCH 3/6] Fix warning in XmlAttributeDeserializer --- RestSharp/Deserializers/XmlAttributeDeserializer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RestSharp/Deserializers/XmlAttributeDeserializer.cs b/RestSharp/Deserializers/XmlAttributeDeserializer.cs index 9b3f9bec6..2cf8a7d6f 100644 --- a/RestSharp/Deserializers/XmlAttributeDeserializer.cs +++ b/RestSharp/Deserializers/XmlAttributeDeserializer.cs @@ -21,6 +21,7 @@ using System.Linq; using System.Xml; using System.Xml.Linq; +using RestSharp.Authenticators.OAuth.Extensions; using RestSharp.Extensions; namespace RestSharp.Deserializers @@ -109,7 +110,8 @@ private void Map(object x, XElement root) var value = GetValueFromXml(root, name, isAttribute); - if (value == null || value == string.Empty) + var stringValue = value as string; + if (stringValue.IsNullOrBlank()) { // special case for inline list items if (type.IsGenericType) From 515acdcc03e6366d9a043b78e29ac4ab594f0dc3 Mon Sep 17 00:00:00 2001 From: Haacked Date: Tue, 10 Sep 2013 10:46:31 -0700 Subject: [PATCH 4/6] Fix bad matching xml tag --- RestSharp/Extensions/ReflectionExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RestSharp/Extensions/ReflectionExtensions.cs b/RestSharp/Extensions/ReflectionExtensions.cs index 3c11215aa..416beb071 100644 --- a/RestSharp/Extensions/ReflectionExtensions.cs +++ b/RestSharp/Extensions/ReflectionExtensions.cs @@ -85,7 +85,7 @@ public static object ChangeType(this object source, Type newType, CultureInfo cu /// Find a value from a System.Enum by trying several possible variants /// of the string value of the enum. /// - /// Type of enum + /// Type of enum /// Value for which to search /// The culture used to calculate the name variants /// From 9b423a8830983de9b88490cabf7b647717a58a77 Mon Sep 17 00:00:00 2001 From: Haacked Date: Tue, 10 Sep 2013 10:46:59 -0700 Subject: [PATCH 5/6] Fix broken unit test If the response is a bad request, we should probably not have anything in the request message. --- RestSharp.IntegrationTests/StatusCodeTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RestSharp.IntegrationTests/StatusCodeTests.cs b/RestSharp.IntegrationTests/StatusCodeTests.cs index c393a41f9..33bfe529c 100644 --- a/RestSharp.IntegrationTests/StatusCodeTests.cs +++ b/RestSharp.IntegrationTests/StatusCodeTests.cs @@ -59,7 +59,7 @@ public void Handles_Different_Root_Element_On_Error() var response = client.Execute(request); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); - Assert.Equal("Not found!", response.Data.Message); + Assert.Null(response.Data); } } From 38cd01f6b9bbf248aec537c880b3f30ff79bb8c6 Mon Sep 17 00:00:00 2001 From: Haacked Date: Tue, 10 Sep 2013 10:47:19 -0700 Subject: [PATCH 6/6] Treat warnings as errors C'mon! This ain't no amateur hour! :trollface: --- RestSharp.Build/RestSharp.Build.csproj | 1 + RestSharp.Net4/RestSharp.Net4.csproj | 1 + RestSharp.Silverlight/RestSharp.Silverlight.csproj | 1 + RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj | 1 + RestSharp/RestSharp.csproj | 1 + 5 files changed, 5 insertions(+) diff --git a/RestSharp.Build/RestSharp.Build.csproj b/RestSharp.Build/RestSharp.Build.csproj index b47a0dcd3..1892a1640 100644 --- a/RestSharp.Build/RestSharp.Build.csproj +++ b/RestSharp.Build/RestSharp.Build.csproj @@ -29,6 +29,7 @@ TRACE prompt 4 + true diff --git a/RestSharp.Net4/RestSharp.Net4.csproj b/RestSharp.Net4/RestSharp.Net4.csproj index e410f8a4b..8601e79e6 100644 --- a/RestSharp.Net4/RestSharp.Net4.csproj +++ b/RestSharp.Net4/RestSharp.Net4.csproj @@ -34,6 +34,7 @@ 4 bin\Release\RestSharp.xml 1591,1573,1658,1584,1574,1572 + true diff --git a/RestSharp.Silverlight/RestSharp.Silverlight.csproj b/RestSharp.Silverlight/RestSharp.Silverlight.csproj index 00a39fd4a..0d272963f 100644 --- a/RestSharp.Silverlight/RestSharp.Silverlight.csproj +++ b/RestSharp.Silverlight/RestSharp.Silverlight.csproj @@ -49,6 +49,7 @@ 4 Bin\Release\RestSharp.Silverlight.xml 1591,1573,1658,1584,1574,1572 + true diff --git a/RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj b/RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj index b95ccd8f2..cd3f4f821 100644 --- a/RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj +++ b/RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj @@ -44,6 +44,7 @@ 4 Bin\Release\RestSharp.WindowsPhone.xml 1591,1573,1658,1584,1574,1572 + true diff --git a/RestSharp/RestSharp.csproj b/RestSharp/RestSharp.csproj index 9691237c5..f5458aa24 100644 --- a/RestSharp/RestSharp.csproj +++ b/RestSharp/RestSharp.csproj @@ -57,6 +57,7 @@ AllRules.ruleset bin\Release\RestSharp.xml 1591,1573,1658,1584,1574,1572 + true