Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion RestSharp.Tests/RestSharp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="SampleClasses\GoogleWeatherWithAttributes.cs" />
<Compile Include="XmlAttributeDeserializerTests.cs" />
<Compile Include="CultureChange.cs" />
<Compile Include="JsonTests.cs" />
<Compile Include="Fakes\NullHttp.cs" />
Expand All @@ -103,7 +105,7 @@
<Compile Include="SerializerTests.cs" />
<Compile Include="SimpleJson.cs" />
<Compile Include="UrlBuilderTests.cs" />
<Compile Include="XmlTests.cs" />
<Compile Include="XmlDeserializerTests.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="SampleData\4sq.txt">
Expand Down
60 changes: 60 additions & 0 deletions RestSharp.Tests/SampleClasses/GoogleWeatherWithAttributes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System.Collections.Generic;
using RestSharp.Deserializers;

namespace RestSharp.Tests.SampleClasses
{
public class GoogleWeatherApi
{
public string Version { get; set; }
public GoogleWeather Weather { get; set; }
}

public class GoogleWeather : List<ForecastConditions>
{
public string ModuleId { get; set; }
public string TabId { get; set; }
public string MobileRow { get; set; }
public string MobileZipped { get; set; }
public string Row { get; set; }
public string Section { get; set; }

[DeserializeAs(Name = "forecast_information")]
public ForecastInformation Forecast { get; set; }

[DeserializeAs(Name = "current_conditions")]
public CurrentConditions Current { get; set; }
}

public class GoogleDataElement
{
public string Data { get; set; }
}

public class ForecastInformation
{
public GoogleDataElement City { get; set; }
public GoogleDataElement PostalCode { get; set; }
public GoogleDataElement ForecastDate { get; set; }
public GoogleDataElement UnitSystem { get; set; }
}

public class CurrentConditions
{
public GoogleDataElement Condition { get; set; }
public GoogleDataElement TempC { get; set; }
public GoogleDataElement Humidity { get; set; }
public GoogleDataElement Icon { get; set; }
public GoogleDataElement WindCondition { get; set; }
}

public class ForecastConditions
{
public GoogleDataElement DayOfWeek { get; set; }
public GoogleDataElement Condition { get; set; }
public GoogleDataElement Low { get; set; }
public GoogleDataElement High { get; set; }
public GoogleDataElement Icon { get; set; }
}


}
Loading