Skip to content

Commit 45f3d5b

Browse files
committed
Verify the XML is correct
1 parent bc2181e commit 45f3d5b

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

Bandwidth.Iris.Tests/Helper.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public async static Task<T> ParseXmlContent<T>(HttpContent content)
3636
{
3737
using (var stream = await content.ReadAsStreamAsync())
3838
{
39-
var serializer = new XmlSerializer(typeof (T));
40-
return (T) serializer.Deserialize(stream);
39+
var serializer = new XmlSerializer(typeof(T));
40+
return (T)serializer.Deserialize(stream);
4141
}
4242
}
4343

@@ -54,11 +54,11 @@ public static T ParseXml<T>(string xml)
5454
public static void AssertObjects(object estimated, object value)
5555
{
5656
var type = estimated.GetType();
57-
foreach(var property in type.GetProperties(BindingFlags.Instance | BindingFlags.Public))
57+
foreach (var property in type.GetProperties(BindingFlags.Instance | BindingFlags.Public))
5858
{
5959
var est = property.GetValue(estimated);
6060
var val = property.GetValue(value);
61-
if(est == null && val == null) continue;
61+
if (est == null && val == null) continue;
6262
var t = (val ?? est).GetType();
6363
if (t.IsPrimitive || val is IComparable)
6464
{
@@ -108,7 +108,7 @@ public static string ToXmlStringMinified(object data)
108108

109109

110110
using (var writer = new Utf8StringWriter())
111-
using (var xmlWriter = XmlWriter.Create(writer, new XmlWriterSettings { Indent = false, OmitXmlDeclaration = true}))
111+
using (var xmlWriter = XmlWriter.Create(writer, new XmlWriterSettings { Indent = false, OmitXmlDeclaration = true }))
112112
{
113113
serializer.Serialize(xmlWriter, data);
114114
return writer.ToString();

Bandwidth.Iris.Tests/Models/ImportTnOrderTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,17 @@ public void TestImportTnOrderWithSubscriber()
442442
};
443443

444444
Assert.Equal("test", order.Subscriber.Name);
445+
446+
using (var server = new HttpServer(new RequestHandler
447+
{
448+
EstimatedMethod = "POST",
449+
EstimatedPathAndQuery = $"/v1.0/accounts/{Helper.AccountId}/importTnOrders",
450+
}))
451+
{
452+
var client = Helper.CreateClient();
453+
ImportTnOrder.Create(client, order).Wait();
454+
if (server.Error != null) throw server.Error;
455+
}
445456
}
446457
}
447458
}

0 commit comments

Comments
 (0)