public void Can_append_read_after_truncate()
 {
     using(var queueStream = new MultiFileQueueStream(_path, 14)) {
         var s1 = GetStream(1);
         var s2 = GetStream(2);
         queueStream.AppendRecord(s1, s1.Length);
         queueStream.AppendRecord(s2, s2.Length);
         queueStream.Truncate();
         var s3 = GetStream(3);
         queueStream.AppendRecord(s3, s3.Length);
         Assert.AreEqual(1, queueStream.UnreadCount);
         var h3 = queueStream.ReadNextRecord();
         Assert.AreEqual(0, queueStream.UnreadCount);
         Assert.AreEqual(GetValue(s3),GetValue(h3.Stream));
     }
 }
 public void Truncate_removes_files()
 {
     using(var queueStream = new MultiFileQueueStream(_path, 14)) {
         var s1 = GetStream(1);
         var s2 = GetStream(2);
         var s3 = GetStream(3);
         var s4 = GetStream(4);
         var s5 = GetStream(5);
         queueStream.AppendRecord(s1, s1.Length);
         queueStream.AppendRecord(s2, s2.Length);
         queueStream.AppendRecord(s3, s3.Length);
         queueStream.AppendRecord(s4, s4.Length);
         queueStream.AppendRecord(s5, s5.Length);
         Assert.AreEqual(3, Directory.GetFiles(_path).Length);
         queueStream.Truncate();
         Assert.AreEqual(1, Directory.GetFiles(_path).Length);
         Assert.AreEqual(0, queueStream.UnreadCount);
         Assert.AreEqual(QueueStreamRecord.Empty, queueStream.ReadNextRecord());
     }
 }