forked from ServiceStack/ServiceStack.Text
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDynamicJsonTests.cs
More file actions
31 lines (27 loc) · 745 Bytes
/
Copy pathDynamicJsonTests.cs
File metadata and controls
31 lines (27 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#if NET40
using NUnit.Framework;
namespace ServiceStack.Text.Tests
{
[TestFixture]
public class DynamicJsonTests
{
[Test]
public void Can_serialize_dynamic_instance()
{
var dog = new { Name = "Spot" };
var json = DynamicJson.Serialize(dog);
Assert.IsNotNull(json);
json.Print();
}
[Test]
public void Can_deserialize_dynamic_instance()
{
var dog = new { Name = "Spot" };
var json = DynamicJson.Serialize(dog);
var deserialized = DynamicJson.Deserialize(json);
Assert.IsNotNull(deserialized);
Assert.AreEqual(dog.Name, deserialized.Name);
}
}
}
#endif