public void Serialize_Wrong_Type_Throws() { // arrange var type = new LongType(); var input = "abc"; // act // assert Assert.Throws <SerializationException>( () => type.Serialize(input)); }
public void Serialize_Null() { // arrange var type = new LongType(); // act var serializedValue = type.Serialize(null); // assert Assert.Null(serializedValue); }
public void Serialize_MaxValue_Violation() { // arrange var type = new LongType(0, 100); long value = 200; // act // assert Assert.Throws <SerializationException>( () => type.Serialize(value)); }
public void Serialize_Type() { // arrange var type = new LongType(); long value = 123; // act var serializedValue = type.Serialize(value); // assert Assert.IsType <long>(serializedValue); Assert.Equal(value, serializedValue); }