示例#1
0
        public void UnencryptedSerializerCannotDeserializeEncryptedEvent()
        {
            var e = new FooEvent { Baz = "Bar" };
            string serializedEncrypted = Serialize(encrypted, e);

            Assert.Throws<SerializationException>(() =>
                Deserialize(plain, serializedEncrypted));
        }
示例#2
0
        public void EncryptedSerializerCanDeserializeEncryptedEvent()
        {
            var e = new FooEvent { Baz = "Bar" };
            string serializedEncrypted = Serialize(encrypted, e);

            var deserialized = Deserialize(encrypted, serializedEncrypted) as FooEvent;

            Assert.NotNull(deserialized);
            Assert.Equal("Bar", deserialized.Baz);
        }