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