public void TestGuid() { // arrange var serializer = new DefaultNaturalKeySerializer(); var naturalKey = Guid.NewGuid(); // act var serializedNaturalKey = serializer.Serialize(typeof(Guid), naturalKey); var deserializedNaturalKey = serializer.Deserialize(typeof(Guid), serializedNaturalKey); // assert Assert.Equal(naturalKey, deserializedNaturalKey); }
public void TestSensibleValueObject() { // arrange var serializer = new DefaultNaturalKeySerializer(); var naturalKey = new SensibleValueObject("Key"); // act var serializedNaturalKey = serializer.Serialize(typeof(SensibleValueObject), naturalKey); var deserializedNaturalKey = serializer.Deserialize(typeof(SensibleValueObject), serializedNaturalKey); // assert Assert.Equal(naturalKey, deserializedNaturalKey); }
public void TestString() { // arrange var serializer = new DefaultNaturalKeySerializer(); var naturalKey = "Key"; // act var serializedNaturalKey = serializer.Serialize(typeof(string), naturalKey); var deserializedNaturalKey = serializer.Deserialize(typeof(string), serializedNaturalKey); // assert Assert.Equal(naturalKey, deserializedNaturalKey); }