예제 #1
0
        public async Task WhenIDeleteStreamInExpectedVersion(string streamId, ulong expectedVersion)
        {
            ScenarioContext.Current.SetStreamId(streamId);
            ScenarioContext.Current.SetExistingDocuments(await CosmosSetup.QueryAllDocuments(this.Context.Client, this.Context.Database, this.Context.Collection));

            await this.Context.EventStore.DeleteStream(ScenarioContext.Current.GetStreamId(), expectedVersion);
        }
예제 #2
0
        public async Task WhenIAppendEventsToStreamInExpectedVersion(int events, string streamId, ushort expectedVersion)
        {
            ScenarioContext.Current.SetStreamId(streamId);
            ScenarioContext.Current.SetNewEvents(TestSetup.GetEvents(events, expectedVersion + 1));
            ScenarioContext.Current.SetExistingDocuments(await CosmosSetup.QueryAllDocuments(this.Context.Client, this.Context.Database, this.Context.Collection));

            await this.Context.EventStore.WriteToStream(ScenarioContext.Current.GetStreamId(), ScenarioContext.Current.GetNewEvents(), expectedVersion, metadata : ScenarioContext.Current.GetHeaderMetadata());
        }
예제 #3
0
        public async Task WhenIWriteNewStreamWithEvents(string streamId, int events)
        {
            ScenarioContext.Current.SetStreamId(streamId);
            ScenarioContext.Current.SetNewEvents(TestSetup.GetEvents(events));
            ScenarioContext.Current.SetExistingDocuments(await CosmosSetup.QueryAllDocuments(this.Context.Client, this.Context.Database, this.Context.Collection));

            await this.Context.EventStore.WriteToStream(ScenarioContext.Current.GetStreamId(), ScenarioContext.Current.GetNewEvents(), metadata : ScenarioContext.Current.GetHeaderMetadata());
        }
예제 #4
0
        public async Task WhenIDeleteStreamInExpectedVersion(string streamId, ulong expectedVersion)
        {
            this.Context.StreamId          = streamId;
            this.Context.ExistingDocuments = await CosmosSetup.QueryAllDocuments(this.Context.Client, this.Context.Database, this.Context.Container);

            var response = await this.Context.EventStore.DeleteStream(streamId, expectedVersion);

            this.Context.Response = response;
        }
예제 #5
0
        public async Task WhenIAppendEventsToStreamInExpectedVersion(int events, string streamId, ushort expectedVersion)
        {
            this.Context.StreamId          = streamId;
            this.Context.NewEvents         = TestSetup.GetEvents(events, expectedVersion + 1);
            this.Context.ExistingDocuments = await CosmosSetup.QueryAllDocuments(this.Context.Client, this.Context.Database, this.Context.Container);

            var response = await this.Context.EventStore.WriteToStream(this.Context.StreamId, this.Context.NewEvents, expectedVersion, metadata : this.Context.HeaderMetadata);

            this.Context.Response = response;
        }
예제 #6
0
        public async Task WhenIWriteNewStreamWithEvents(string streamId, int events)
        {
            this.Context.StreamId          = streamId;
            this.Context.NewEvents         = TestSetup.GetEvents(events);
            this.Context.ExistingDocuments = await CosmosSetup.QueryAllDocuments(this.Context.Client, this.Context.Database, this.Context.Container);

            var response = await this.Context.EventStore.WriteToStream(this.Context.StreamId, this.Context.NewEvents, metadata : this.Context.HeaderMetadata);

            this.Context.Response = response;
        }