コード例 #1
0
ファイル: KeyFormatTests.cs プロジェクト: tthtun/Cirqus
        public void CanGetTypeById()
        {
            KeyFormat.For <int>("i-{Username}");
            KeyFormat.For <double>("d-guid");

            KeyFormat.GetTypeById("d-9EA4FEC2-AA9F-460A-A2B7-60903218149D").ShouldBe(typeof(double));
        }
コード例 #2
0
ファイル: IdTests.cs プロジェクト: tthtun/Cirqus
 public void FailsWhenRegisteringTypesWithNoLiteralIdentifier()
 {
     Should.Throw <ParseException>(() =>
     {
         KeyFormat.For <object>("guid-sguid-{placeholder}-*");
     });
 }
コード例 #3
0
ファイル: TestCirqusTests.cs プロジェクト: tthtun/Cirqus
        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");
        }
コード例 #4
0
ファイル: IdTests.cs プロジェクト: tthtun/Cirqus
 public IdTests()
 {
     KeyFormat.For <GuidKeyedRoot>("hest-guid");
     KeyFormat.For <PlaceholderKeyedRoot>("hest-{String}-{Int}-{Long}-*");
 }