Exemplo n.º 1
0
        public void CanGetTypeById()
        {
            KeyFormat.For <int>("i-{Username}");
            KeyFormat.For <double>("d-guid");

            KeyFormat.GetTypeById("d-9EA4FEC2-AA9F-460A-A2B7-60903218149D").ShouldBe(typeof(double));
        }
Exemplo n.º 2
0
 public void FailsWhenRegisteringTypesWithNoLiteralIdentifier()
 {
     Should.Throw <ParseException>(() =>
     {
         KeyFormat.For <object>("guid-sguid-{placeholder}-*");
     });
 }
Exemplo n.º 3
0
        public void EmitToAnyStream()
        {
            KeyFormat.For <object>("stream-*");

            Emit <object>("stream-id", new EventWithNoRoot());

            var @event = Context.History.Single();

            @event.ShouldBeOfType <EventWithNoRoot>();
            @event.Meta[DomainEvent.MetadataKeys.AggregateRootId].ShouldBe("stream-id");
            @event.Meta[DomainEvent.MetadataKeys.Owner].ShouldBe("System.Object, mscorlib");
        }
Exemplo n.º 4
0
 public IdTests()
 {
     KeyFormat.For <GuidKeyedRoot>("hest-guid");
     KeyFormat.For <PlaceholderKeyedRoot>("hest-{String}-{Int}-{Long}-*");
 }