Пример #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);
        }