Skip to content

Commit

Permalink
explicit test checking each property of Nullable type
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Feb 20, 2011
1 parent 17b2a65 commit e18f9af
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/ServiceStack.Text.Tests/NullableTypesTests.cs
Expand Up @@ -5,21 +5,30 @@ namespace ServiceStack.Text.Tests
{
[TestFixture]
public class NullableTypesTests
: TestBase
{
[Test]
public void Can_Serialize_populated_model_of_NullableTypes()
{
var model = ModelWithFieldsOfNullableTypes.Create(1);
Serialize(model);

var json = JsonSerializer.SerializeToString(model);

var fromJson = JsonSerializer.DeserializeFromString<ModelWithFieldsOfNullableTypes>(json);

ModelWithFieldsOfNullableTypes.AssertIsEqual(model, fromJson);
}

[Test]
public void Can_Serialize_empty_model_of_NullableTypes()
{
var model = new ModelWithFieldsOfNullableTypes();
Serialize(model);
}

var json = JsonSerializer.SerializeToString(model);

var fromJson = JsonSerializer.DeserializeFromString<ModelWithFieldsOfNullableTypes>(json);

ModelWithFieldsOfNullableTypes.AssertIsEqual(model, fromJson);
}
}

}

0 comments on commit e18f9af

Please sign in to comment.