Beispiel #1
0
        public void OperationFailedSignal_Always_CopiesMessageData()
        {
            var @event = fixture.Create <TestCreatedEvent>();

            var signal = new OperationFailedSignal(@event, new FailedResult(CoreErrorCodes.ValidationFailed));

            signal.Should().BeEquivalentTo(@event, options => options.ForMessage());
        }
Beispiel #2
0
        public void OperationFailedSignal_Always_Serializable()
        {
            var source = new OperationFailedSignal(fixture.Create <TestCreatedEvent>(), new FailedResult(CoreErrorCodes.ValidationFailed));

            var serialized   = JsonConvert.SerializeObject(source);
            var deserialized = JsonConvert.DeserializeObject <OperationFailedSignal>(serialized);

            deserialized.Should().BeEquivalentTo(source);
        }