Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public void ShouldThrowIfDeserializingLessThanEightBytes(byte[] data)
        {
            Serializer <double> serializer = new DoubleSerializer();

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

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