public void NewInfoObject() { //------------ Act var info = new ProjectionInfo(ProjectionTestsHelper.GetViewInfos(1), ProjectionTestsHelper.GetProjection(1), new DocumentStrategy()); //------------ Assert info.GetEventStreamVersion().Should().Be(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))); }
private ExpectedProjectionVersion(int projectionNumber, long expectedEventVersion) { var projection = ProjectionTestsHelper.GetProjection(projectionNumber); this.ProjectionType = projection.GetType(); this.CheckpointFile = this.ProjectionType.Name; this.ExpectedEventVersion = expectedEventVersion; }
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); }
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); }
private static ProjectionInfo CreateInfo(int i) { return(new ProjectionInfo(ProjectionTestsHelper.GetViewInfos(i), ProjectionTestsHelper.GetProjection(i), new DocumentStrategy())); }
private ProjectionsRebuilder <TestEvent> CreateRebuilder(params int[] projectionNumbers) { return(new ProjectionsRebuilder <TestEvent>("test", this._documentStorage, this._eventStore, s => ProjectionTestsHelper.GetProjections(s, projectionNumbers))); }