public void SerializeAndDeserializeToTheSameObject(sbyte originalValue) { Serializer <sbyte> serializer = new SByteSerializer(); byte[] serializedValue = serializer.Serialize(originalValue); sbyte deserializedValue = serializer.Deserialize(serializedValue); Assert.Equal(originalValue, deserializedValue); }
public void ThrowIfDeserializingLessThanOneByte() { Serializer <sbyte> serializer = new SByteSerializer(); Assert.Throws <ArgumentOutOfRangeException>(() => serializer.Deserialize(new byte[] { })); }
public void ThrowIfDeserializingNull() { Serializer <sbyte> serializer = new SByteSerializer(); Assert.Throws <ArgumentNullException>(() => serializer.Deserialize(null)); }