public void ReturnNullIfDeserializingNull()
        {
            Serializer <TimeSpan?> serializer = new NullableTimeSpanSerializer();
            TimeSpan?actualDeserializedValue  = serializer.Deserialize(null);

            Assert.Null(actualDeserializedValue);
        }
        public void SerializeAndDeserializeToTheSameObject(TimeSpan?originalValue)
        {
            Serializer <TimeSpan?> serializer = new NullableTimeSpanSerializer();

            byte[]   serializedValue   = serializer.Serialize(originalValue);
            TimeSpan?deserializedValue = serializer.Deserialize(serializedValue);

            Assert.Equal(originalValue, deserializedValue);
        }
        public void ShouldThrowIfDeserializingLessThanEightBytes(byte[] data)
        {
            Serializer <TimeSpan?> serializer = new NullableTimeSpanSerializer();

            Assert.Throws <ArgumentOutOfRangeException>(() => serializer.Deserialize(data));
        }