Skip to content

Commit 5b54093

Browse files
committed
Fixed whitespace issues
1 parent 7a2799d commit 5b54093

File tree

2 files changed

+73
-73
lines changed

2 files changed

+73
-73
lines changed

RestSharp.Tests/SerializerTests.cs

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void Can_serialize_Enum()
8585
expected.Add(root);
8686

8787
Assert.Equal( expected.ToString(), doc.ToString() );
88-
}
88+
}
8989

9090
[Fact]
9191
public void Can_serialize_simple_POCO_With_DateFormat_Specified() {
@@ -157,34 +157,34 @@ public void Can_serialize_simple_POCO_With_Attribute_Options_Defined() {
157157
Assert.Equal(expected.ToString(), doc.ToString());
158158
}
159159

160-
[Fact]
161-
public void Can_serialize_simple_POCO_With_Attribute_Options_Defined_And_Property_Containing_IList_Elements()
162-
{
163-
var poco = new WackyPerson
164-
{
165-
Name = "Foo",
166-
Age = 50,
167-
Price = 19.95m,
168-
StartDate = new DateTime(2009, 12, 18, 10, 2, 23),
169-
ContactData = new ContactData
170-
{
171-
EmailAddresses = new List<EmailAddress>
172-
{
173-
new EmailAddress
174-
{
175-
Address = "[email protected]",
176-
Location = "Work"
177-
}
178-
}
179-
}
180-
};
181-
182-
var xml = new XmlSerializer();
183-
var doc = xml.Serialize(poco);
184-
var expected = GetSimplePocoXDocWackyNamesWithIListProperty();
185-
186-
Assert.Equal(expected.ToString(), doc.ToString());
187-
}
160+
[Fact]
161+
public void Can_serialize_simple_POCO_With_Attribute_Options_Defined_And_Property_Containing_IList_Elements()
162+
{
163+
var poco = new WackyPerson
164+
{
165+
Name = "Foo",
166+
Age = 50,
167+
Price = 19.95m,
168+
StartDate = new DateTime(2009, 12, 18, 10, 2, 23),
169+
ContactData = new ContactData
170+
{
171+
EmailAddresses = new List<EmailAddress>
172+
{
173+
new EmailAddress
174+
{
175+
Address = "[email protected]",
176+
Location = "Work"
177+
}
178+
}
179+
}
180+
};
181+
182+
var xml = new XmlSerializer();
183+
var doc = xml.Serialize(poco);
184+
var expected = GetSimplePocoXDocWackyNamesWithIListProperty();
185+
186+
Assert.Equal(expected.ToString(), doc.ToString());
187+
}
188188

189189
[Fact]
190190
public void Can_serialize_a_list_which_is_the_root_element()
@@ -268,36 +268,36 @@ private class WackyPerson
268268
[SerializeAs(Name = "start_date", Attribute = true)]
269269
public DateTime StartDate { get; set; }
270270

271-
[SerializeAs(Name = "contact-data")]
272-
public ContactData ContactData { get; set; }
271+
[SerializeAs(Name = "contact-data")]
272+
public ContactData ContactData { get; set; }
273273
}
274274

275275
[SerializeAs(Name = "People")]
276276
private class PersonList : List<Person>
277277
{
278-
278+
279279
}
280280

281-
private class ContactData
282-
{
283-
public ContactData()
284-
{
285-
EmailAddresses = new List<EmailAddress>();
286-
}
281+
private class ContactData
282+
{
283+
public ContactData()
284+
{
285+
EmailAddresses = new List<EmailAddress>();
286+
}
287287

288-
[SerializeAs(Name = "email-addresses")]
289-
public List<EmailAddress> EmailAddresses { get; set; }
290-
}
288+
[SerializeAs(Name = "email-addresses")]
289+
public List<EmailAddress> EmailAddresses { get; set; }
290+
}
291291

292-
[SerializeAs(Name = "email-address")]
293-
private class EmailAddress
294-
{
295-
[SerializeAs(Name = "address")]
296-
public string Address { get; set; }
292+
[SerializeAs(Name = "email-address")]
293+
private class EmailAddress
294+
{
295+
[SerializeAs(Name = "address")]
296+
public string Address { get; set; }
297297

298-
[SerializeAs(Name = "location")]
299-
public string Location { get; set; }
300-
}
298+
[SerializeAs(Name = "location")]
299+
public string Location { get; set; }
300+
}
301301

302302
private XDocument GetSimplePocoXDoc()
303303
{
@@ -376,25 +376,25 @@ private XDocument GetSimplePocoXDocWackyNames() {
376376
return doc;
377377
}
378378

379-
private XDocument GetSimplePocoXDocWackyNamesWithIListProperty()
380-
{
381-
var doc = new XDocument();
382-
var root = new XElement("Person");
383-
root.Add(new XAttribute("WackyName", "Foo"),
384-
new XElement("Age", 50),
385-
new XAttribute("Price", 19.95m),
386-
new XAttribute("start_date", new DateTime(2009, 12, 18, 10, 2, 23).ToString()),
387-
new XElement("contact-data",
388-
new XElement("email-addresses",
389-
new XElement("email-address",
390-
new XElement("address", "[email protected]"),
391-
new XElement("location", "Work")
392-
))));
393-
394-
doc.Add(root);
395-
396-
return doc;
397-
}
379+
private XDocument GetSimplePocoXDocWackyNamesWithIListProperty()
380+
{
381+
var doc = new XDocument();
382+
var root = new XElement("Person");
383+
root.Add(new XAttribute("WackyName", "Foo"),
384+
new XElement("Age", 50),
385+
new XAttribute("Price", 19.95m),
386+
new XAttribute("start_date", new DateTime(2009, 12, 18, 10, 2, 23).ToString()),
387+
new XElement("contact-data",
388+
new XElement("email-addresses",
389+
new XElement("email-address",
390+
new XElement("address", "[email protected]"),
391+
new XElement("location", "Work")
392+
))));
393+
394+
doc.Add(root);
395+
396+
return doc;
397+
}
398398

399399
private XDocument GetSortedPropsXDoc() {
400400
var doc = new XDocument();

RestSharp/Serializers/XmlSerializer.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ where p.CanRead && p.CanWrite
148148
foreach (var item in (IList)rawValue) {
149149
if (itemTypeName == "")
150150
{
151-
var type = item.GetType();
152-
var setting = type.GetAttribute<SerializeAsAttribute>();
153-
itemTypeName = setting != null && setting.Name.HasValue()
154-
? setting.Name
155-
: type.Name;
151+
var type = item.GetType();
152+
var setting = type.GetAttribute<SerializeAsAttribute>();
153+
itemTypeName = setting != null && setting.Name.HasValue()
154+
? setting.Name
155+
: type.Name;
156156
}
157157
var instance = new XElement(itemTypeName);
158158
Map(instance, item);

0 commit comments

Comments
 (0)