public void Write_FailWithNoGlobalLatestCells() { var dir = new SubGridDirectory(); Action act = () => dir.Write(new BinaryWriter(new MemoryStream(Consts.TREX_DEFAULT_MEMORY_STREAM_CAPACITY_ON_CREATION))); act.Should().Throw <TRexSubGridIOException>().WithMessage("Cannot write sub grid directory without global latest values available"); }
public void Creation() { var dir = new SubGridDirectory(); dir.ExistsInPersistentStore.Should().BeFalse(); dir.GlobalLatestCells.Should().BeNull(); dir.IsMutable.Should().BeFalse(); dir.SegmentDirectory.Should().NotBeNull(); }
public void Write_FailWithNoSegmentsInDirectory() { var dir = new SubGridDirectory(); dir.AllocateGlobalLatestCells(); Action act = () => dir.Write(new BinaryWriter(new MemoryStream(Consts.TREX_DEFAULT_MEMORY_STREAM_CAPACITY_ON_CREATION))); act.Should().Throw <TRexSubGridIOException>().WithMessage("Writing a segment directory with no segments"); }