public void UnencryptedSerializerCannotDeserializeEncryptedEvent() { var e = new FooEvent { Baz = "Bar" }; string serializedEncrypted = Serialize(encrypted, e); Assert.Throws<SerializationException>(() => Deserialize(plain, serializedEncrypted)); }
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); }