示例#1
0
        public void SerializeAndDeserializeToTheSameObject(double originalValue)
        {
            Serializer <double> serializer = new DoubleSerializer();

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

            Assert.Equal(originalValue, deserializedValue);
        }
示例#2
0
        public void ShouldThrowIfDeserializingLessThanEightBytes(byte[] data)
        {
            Serializer <double> serializer = new DoubleSerializer();

            Assert.Throws <ArgumentOutOfRangeException>(() => serializer.Deserialize(data));
        }
示例#3
0
        public void ShouldThrowIfDeserializingNull()
        {
            Serializer <double> serializer = new DoubleSerializer();

            Assert.Throws <ArgumentNullException>(() => serializer.Deserialize(null));
        }