-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
commercetools.Sdk/Tests/commercetools.Api.Serialization.Tests/AddressTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.IO; | ||
using commercetools.Api.Models.Common; | ||
using Xunit; | ||
|
||
namespace commercetools.Api.Serialization.Tests | ||
{ | ||
public class AddressTests: IClassFixture<SerializationFixture> | ||
{ | ||
private readonly SerializationFixture _serializationFixture; | ||
|
||
public AddressTests(SerializationFixture serializationFixture) | ||
{ | ||
this._serializationFixture = serializationFixture; | ||
} | ||
|
||
[Fact] | ||
public void poBoxAddress() | ||
{ | ||
var serializerService = this._serializationFixture.SerializerService; | ||
var serialized = "{\"pOBox\": \"12345\"}"; | ||
var deserialized = serializerService.Deserialize<Address>(serialized); | ||
Assert.NotNull(deserialized); | ||
Assert.Equal("12345", deserialized.POBox); | ||
|
||
Assert.Equal("{\"pOBox\":\"12345\"}", serializerService.Serialize(deserialized)); | ||
} | ||
[Fact] | ||
public void poBoxAddressDraft() | ||
{ | ||
var serializerService = this._serializationFixture.SerializerService; | ||
var serialized = "{\"pOBox\": \"12345\"}"; | ||
var deserialized = serializerService.Deserialize<AddressDraft>(serialized); | ||
Assert.NotNull(deserialized); | ||
Assert.Equal("12345", deserialized.POBox); | ||
|
||
Assert.Equal("{\"pOBox\":\"12345\"}", serializerService.Serialize(deserialized)); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters