public void CreateFromSource2_Always_CopiesMessageCorrelationData()
        {
            var integrationEvent = Fixtures.Pipelines.FakeCreatedIntegrationEvent();

            var signal = QueryModelChangedSignal.CreateFromSource(
                integrationEvent,
                Unified.NewCode(),
                typeof(int),
                FixtureUtils.FromEnum <QueryModelChangeOperation>());

            signal.Should().BeEquivalentTo(integrationEvent, options => options.ForMessage());
        }
        public void Constructor_Always_UpdatesProperties()
        {
            var queryModelId      = Unified.NewCode();
            var queryModelVersion = FixtureUtils.Int();
            var queryModelType    = typeof(int);
            var operation         = FixtureUtils.FromEnum <QueryModelChangeOperation>();

            var signal = new QueryModelChangedSignal(queryModelId, queryModelVersion, queryModelType, operation);

            signal.QueryModelId.Should().Be(queryModelId);
            signal.QueryModelVersion.Should().Be(queryModelVersion);
            signal.QueryModelType.Should().Be(queryModelType);
            signal.Operation.Should().Be(operation);
        }
Ejemplo n.º 3
0
        public void Deserialize_EnumObject_WorksCorrectly()
        {
            var source = new EnumObject
            {
                TestEnumProperty        = FixtureUtils.FromEnum <TestEnum>(),
                ChildEnumObjectProperty = new ChildEnumObject {
                    TestEnumProperty = FixtureUtils.FromEnum <TestEnum>()
                }
            };

            var serialized   = AzureTableSerializer.Serialize(source);
            var deserialized = AzureTableSerializer.Deserialize <EnumObject>(Entity(serialized));

            deserialized.Should().BeEquivalentTo(source, options => options
                                                 .Excluding(o => o.Timestamp));
        }
Ejemplo n.º 4
0
 public static ChildPrivateConstructorObject CreateRandom()
 {
     return(new ChildPrivateConstructorObject(
                new ChildNoDefaultConstructorObject(FixtureUtils.String()),
                FixtureUtils.FromEnum <TestEnum>()));
 }
        public void QueryModelChangedSignal_Always_SerializedCorrectly()
        {
            var signal = new QueryModelChangedSignal(Unified.NewCode(), FixtureUtils.Int(), typeof(int), FixtureUtils.FromEnum <QueryModelChangeOperation>())
            {
                CorrelationId   = Unified.NewCode(),
                AggregateRootId = Unified.NewCode(),
                Metadata        = { [MetadataKey.UserId] = Unified.NewCode() },
                Actor           = { IdentityId = Unified.NewCode(), UserId = Unified.NewCode(), IsProcessManager = true }
            };

            var json         = JsonConvert.SerializeObject(signal);
            var deserialized = JsonConvert.DeserializeObject <QueryModelChangedSignal>(json);

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