示例#1
0
            public void NewInfoObject()
            {
                //------------ Act
                var info = new ProjectionInfo(ProjectionTestsHelper.GetViewInfos(1), ProjectionTestsHelper.GetProjection(1), new DocumentStrategy());

                //------------ Assert
                info.GetEventStreamVersion().Should().Be(0);
            }
示例#2
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);
            }
示例#3
0
        public void ProjectionHashChanges_ProjectionRebuilt()
        {
            //------------ Arrange
            var loadedProjections    = LoadInfoList(2);
            var generatedProjections = new List <ProjectionInfo> {
                new ProjectionInfo(ProjectionTestsHelper.GetViewInfos(2), new DifferentHash.ProjectionMock2(null), new DocumentStrategy())
            };

            //------------ Act
            var projectionsPartition = PartitionedProjectionsInfo.Partition(loadedProjections, generatedProjections, this._storage);

            //------------ Assert
            var expectedGeneratedProjections = new List <ProjectionInfo> {
                new ProjectionInfo(ProjectionTestsHelper.GetViewInfos(2), new DifferentHash.ProjectionMock2(null), new DocumentStrategy())
            };

            projectionsPartition.ReadyForUse.Should().BeEmpty();
            projectionsPartition.NeedRebuild.Should().Equal(expectedGeneratedProjections);
            projectionsPartition.Obsolete.Should().BeEmpty();
            AssertProjectionInfosInitialized(projectionsPartition);
        }
示例#4
0
 private static ProjectionInfo CreateInfo(int i)
 {
     return(new ProjectionInfo(ProjectionTestsHelper.GetViewInfos(i), ProjectionTestsHelper.GetProjection(i), new DocumentStrategy()));
 }