Exemplo n.º 1
0
        private static ProjectionHash CreateHash(params int[] viewNumbers)
        {
            Condition.Requires(viewNumbers, "viewNumbers").IsNotEmpty();
            var viewTypes  = ProjectionTestsHelper.GetViews(viewNumbers);
            var projection = ProjectionTestsHelper.GetProjection(viewNumbers[0]);

            return(new ProjectionHash(projection.GetType(), viewTypes, typeof(DocumentStrategy)));
        }
Exemplo n.º 2
0
            public void NewInfoObject()
            {
                //------------ Act
                var info = new ProjectionInfo(ProjectionTestsHelper.GetViewInfos(1), ProjectionTestsHelper.GetProjection(1), new DocumentStrategy());

                //------------ Assert
                info.GetEventStreamVersion().Should().Be(0);
            }
Exemplo n.º 3
0
            private ExpectedProjectionVersion(int projectionNumber, long expectedEventVersion)
            {
                var projection = ProjectionTestsHelper.GetProjection(projectionNumber);

                this.ProjectionType       = projection.GetType();
                this.CheckpointFile       = this.ProjectionType.Name;
                this.ExpectedEventVersion = expectedEventVersion;
            }
Exemplo n.º 4
0
 private static ProjectionInfo CreateInfo(int i)
 {
     return(new ProjectionInfo(ProjectionTestsHelper.GetViewInfos(i), ProjectionTestsHelper.GetProjection(i), new DocumentStrategy()));
 }
Exemplo n.º 5
0
            public void LoadedInfo()
            {
                //------------ Arrange
                this.MockSaveCheckpoint();
                this.MockLoadCheckpoint();

                var originalInfo = new ProjectionInfo(ProjectionTestsHelper.GetViewInfos(1), ProjectionTestsHelper.GetProjection(1), new DocumentStrategy());

                originalInfo.Initialize(this._storage);
                const int checkpoint = 1521516;

                originalInfo.UpdateEventStreamVersion(checkpoint).Wait();

                //------------ Act
                var info = this.ReloadProjectionInfo(originalInfo);

                //------------ Assert
                info.GetEventStreamVersion().Should().Be(checkpoint);
            }