Skip to content

Commit d15f0a8

Browse files
committed
Merge pull request #419 from restsharp/more-cleanup
More cleanup
2 parents 0777793 + 38cd01f commit d15f0a8

File tree

9 files changed

+15
-8
lines changed

9 files changed

+15
-8
lines changed

RestSharp.Build/RestSharp.Build.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<DefineConstants>TRACE</DefineConstants>
3030
<ErrorReport>prompt</ErrorReport>
3131
<WarningLevel>4</WarningLevel>
32+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3233
</PropertyGroup>
3334
<ItemGroup>
3435
<Reference Include="Microsoft.Build.Framework" />

RestSharp.IntegrationTests/StatusCodeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void Handles_Different_Root_Element_On_Error()
5959
var response = client.Execute<Response>(request);
6060

6161
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
62-
Assert.Equal("Not found!", response.Data.Message);
62+
Assert.Null(response.Data);
6363
}
6464
}
6565

RestSharp.Net4/RestSharp.Net4.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
3535
<DocumentationFile>bin\Release\RestSharp.xml</DocumentationFile>
36-
<NoWarn>1591,1573,1658,1584</NoWarn>
36+
<NoWarn>1591,1573,1658,1584,1574,1572</NoWarn>
37+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
3738
</PropertyGroup>
3839
<ItemGroup>
3940
<Reference Include="System" />

RestSharp.Silverlight/RestSharp.Silverlight.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
<ErrorReport>prompt</ErrorReport>
4949
<WarningLevel>4</WarningLevel>
5050
<DocumentationFile>Bin\Release\RestSharp.Silverlight.xml</DocumentationFile>
51-
<NoWarn>1591,1573,1658,1584</NoWarn>
51+
<NoWarn>1591,1573,1658,1584,1574,1572</NoWarn>
52+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
5253
</PropertyGroup>
5354
<ItemGroup>
5455
<Reference Include="mscorlib" />

RestSharp.Tests/NuSpecUpdateTask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class WhenSpecFileIsValid : BaseNuSpecUpdateTest
6767
private string _expectedDescription = "Simple REST and HTTP API Client";
6868
private string _expectedAuthors = "John Sheehan, RestSharp Community";
6969
private string _expectedOwners = "John Sheehan, RestSharp Community";
70-
private Regex _expectedVersion = new Regex(@"^\d+\.\d+\.\d+$", RegexOptions.Compiled);
70+
private Regex _expectedVersion = new Regex(@"^\d+\.\d+\.\d+(-\w+)$", RegexOptions.Compiled);
7171

7272
protected override void Setup()
7373
{

RestSharp.WindowsPhone/RestSharp.WindowsPhone.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
<ErrorReport>prompt</ErrorReport>
4444
<WarningLevel>4</WarningLevel>
4545
<DocumentationFile>Bin\Release\RestSharp.WindowsPhone.xml</DocumentationFile>
46-
<NoWarn>1591,1573,1658,1584</NoWarn>
46+
<NoWarn>1591,1573,1658,1584,1574,1572</NoWarn>
47+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
4748
</PropertyGroup>
4849
<ItemGroup>
4950
<Reference Include="mscorlib" />

RestSharp/Deserializers/XmlAttributeDeserializer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using System.Linq;
2222
using System.Xml;
2323
using System.Xml.Linq;
24+
using RestSharp.Authenticators.OAuth.Extensions;
2425
using RestSharp.Extensions;
2526

2627
namespace RestSharp.Deserializers
@@ -109,7 +110,8 @@ private void Map(object x, XElement root)
109110

110111
var value = GetValueFromXml(root, name, isAttribute);
111112

112-
if (value == null || value == string.Empty)
113+
var stringValue = value as string;
114+
if (stringValue.IsNullOrBlank())
113115
{
114116
// special case for inline list items
115117
if (type.IsGenericType)

RestSharp/Extensions/ReflectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static object ChangeType(this object source, Type newType, CultureInfo cu
8585
/// Find a value from a System.Enum by trying several possible variants
8686
/// of the string value of the enum.
8787
/// </summary>
88-
/// <param name="type">Type of enum</typeparam>
88+
/// <param name="type">Type of enum</param>
8989
/// <param name="value">Value for which to search</param>
9090
/// <param name="culture">The culture used to calculate the name variants</param>
9191
/// <returns></returns>

RestSharp/RestSharp.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
<WarningLevel>4</WarningLevel>
5757
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
5858
<DocumentationFile>bin\Release\RestSharp.xml</DocumentationFile>
59-
<NoWarn>1591,1573,1658,1584</NoWarn>
59+
<NoWarn>1591,1573,1658,1584,1574,1572</NoWarn>
60+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
6061
</PropertyGroup>
6162
<ItemGroup>
6263
<Reference Include="Microsoft.Build.Framework" />

0 commit comments

Comments
 (0)