Ejemplo n.º 1
0
        public void Should_take_event_name_based_on_attribute()
        {
            var stubAggregate    = StubAggregate.Create("Test");
            var metadataProvider = new EventTypeMetadataProvider();
            var metadatas        = stubAggregate.UncommitedEvents.SelectMany(e => metadataProvider.Provide(stubAggregate, e, EventSource.Metadata.Empty));

            var metadata = new EventSource.Metadata(metadatas);

            metadata.GetValue(MetadataKeys.EventName).Should().Be("StubCreated");
        }
Ejemplo n.º 2
0
        public void Event_MetadataProvider()
        {
            var stubAggregate = StubAggregate.Create("Test");

            var metadataProvider = new EventTypeMetadataProvider();

            var metadata = stubAggregate.UncommitedEvents.SelectMany(e => metadataProvider.Provide(stubAggregate, e, EventSource.Metadata.Empty));

            metadata.Count().Should().Be(2);
        }