public void GivenNoValuesThenCausationIsSetToEmptyAndANewCorrelationIsGenerated() { var message = new SerializableMessage(); Assert.Equal(Guid.Empty, message.CausationId); Assert.NotEqual(Guid.Empty, message.CorrelationId); }
public void GivenTwoEntitiesWithTheSameIdsButDifferentTypesThenAPositiveResponseIsReturned() { var first = new SerializableMessage(); var second = new SerializableEntity <Guid>(first.Id); Assert.True(first != second); Assert.True(second != first); }
public void GivenTwoMessagesWithDifferentIdsAndTheSameTypeThenAPositiveResponseIsReturned() { var first = new SerializableMessage(); var second = new SerializableMessage(); Assert.True(first != second); Assert.True(second != first); }
public void GivenTwoMessagesWithTheSameIdAndTypeThenANegativeResponseIsReturned() { var first = new SerializableMessage(); SerializableMessage second = first.Clone(); Assert.False(first != second); Assert.False(second != first); }
public void GivenAnInstanceBasedOnAnInstanceThenTheCorrelationPropagatedAndTheCausationIsSetToTheIdOfTheOriginal() { var expected = new SerializableMessage(); var message = new SerializableMessage(context: expected); Assert.Equal(expected.Id, message.CausationId); Assert.Equal(expected.CorrelationId, message.CorrelationId); }
public void GivenTwoEntitiesWithTheSameIdsButDifferentTypesThenANegativeResponseIsReturned() { var first = new SerializableMessage(); var second = new SerializableEntity <Guid>(first.Id); Assert.False(first == second); Assert.False(first.Equals(second)); Assert.False(second == first); }
public void GivenTwoMessagesWithTheSameIdAndTypeThenAPositiveResponseIsReturned() { var first = new SerializableMessage(); SerializableMessage second = first.Clone(); Assert.Equal(first, second); Assert.True(first == second); Assert.True(first.Equals(second)); Assert.True(second == first); }
public void GivenTwoMessagesWithDifferentIdsAndTheSameTypeThenANegativeResponseIsReturned() { var first = new SerializableMessage(); var second = new SerializableMessage(); Assert.NotEqual(first, second); Assert.False(first == second); Assert.False(first.Equals(second)); Assert.False(second == first); }
public void GivenAnInstanceThenAllPropertiesAreSerialized() { var original = new SerializableMessage(); SerializableMessage deserialized = original.Clone(); Assert.Equal(original, deserialized); Assert.NotSame(original, deserialized); Assert.Equal(original.CausationId, deserialized.CausationId); Assert.Equal(original.CorrelationId, deserialized.CorrelationId); Assert.Equal(original.Id, deserialized.Id); Assert.Equal(original.TimeStamp, deserialized.TimeStamp); Assert.Equal(original.GetHashCode(), deserialized.GetHashCode()); }