Ejemplo n.º 1
0
        public void the_second_record_can_be_read_as_closest_forward_after_first()
        {
            var res = _chunk.TryReadClosestForward(_prepare1.GetSizeWithLengthPrefixAndSuffix());

            Assert.IsTrue(res.Success);
            Assert.AreEqual(_prepare1.GetSizeWithLengthPrefixAndSuffix()
                            + _prepare2.GetSizeWithLengthPrefixAndSuffix(), res.NextPosition);
            Assert.IsTrue(res.LogRecord is IPrepareLogRecord <TStreamId>);
            Assert.AreEqual(_prepare2, res.LogRecord);
        }
Ejemplo n.º 2
0
        public void the_first_record_can_be_read()
        {
            var res = _chunk.TryReadFirst();

            Assert.IsTrue(res.Success);
            Assert.AreEqual(_prepare1.GetSizeWithLengthPrefixAndSuffix(), res.NextPosition);
            Assert.IsTrue(res.LogRecord is IPrepareLogRecord <TStreamId>);
            Assert.AreEqual(_prepare1, res.LogRecord);
        }
 public void the_checksum_is_updated()
 {
     Assert.AreEqual(_record.GetSizeWithLengthPrefixAndSuffix(), _writerCheckpoint.Read());
 }
Ejemplo n.º 4
0
 public void the_write_result_is_correct()
 {
     Assert.IsTrue(_result.Success);
     Assert.AreEqual(0, _result.OldPosition);
     Assert.AreEqual(_record.GetSizeWithLengthPrefixAndSuffix(), _result.NewPosition);
 }
Ejemplo n.º 5
0
 public void the_updated_position_is_returned()
 {
     //position without header.
     Assert.AreEqual(_record.GetSizeWithLengthPrefixAndSuffix(), _result.NewPosition);
 }