public void metastream_read_returns_metaevent()
 {
     var result = ReadIndex.ReadEvent(SystemStreams.MetastreamOf("ES"), 0);
     Assert.AreEqual(ReadEventResult.Success, result.Result);
     Assert.AreEqual(_r1, result.Record);
 }
 public void return_correct_first_record_for_event_stream_with_two_events()
 {
     var result = ReadIndex.ReadEvent("ESES", 0);
     Assert.AreEqual(ReadEventResult.Success, result.Result);
     Assert.AreEqual(_prepare2, result.Record);
 }
Example #3
0
        public void return_not_found_for_record_version_0_for_stream_with_same_hash_as_second_stream()
        {
            EventRecord record;

            Assert.AreEqual(SingleReadResult.NoStream, ReadIndex.ReadEvent("FY", 0, out record));
        }
 public void not_find_record_for_nonexistent_event_stream_with_same_hash_as_existing_one()
 {
     var result = ReadIndex.ReadEvent("AB", 0);
     Assert.AreEqual(ReadEventResult.NoStream, result.Result);
     Assert.IsNull(result.Record);
 }
 public void not_find_record_with_nonexistent_version_for_event_stream_with_two_events()
 {
     var result = ReadIndex.ReadEvent("ESES", 2);
     Assert.AreEqual(ReadEventResult.NotFound, result.Result);
     Assert.IsNull(result.Record);
 }
Example #6
0
        public void return_not_found_for_record_version_7_for_stream_with_same_hash_as_third_stream()
        {
            var result = ReadIndex.ReadEvent("FY", 7);

            Assert.AreEqual(ReadEventResult.NoStream, result.Result);
        }
Example #7
0
 public void last_event_read_reports_deleted_metastream()
 {
     Assert.AreEqual(ReadEventResult.StreamDeleted, ReadIndex.ReadEvent("$$test", -1).Result);
 }
Example #8
0
        public void not_find_record_with_nonexistent_version_for_smaller_stream()
        {
            EventRecord prepare;

            Assert.AreEqual(SingleReadResult.NotFound, ReadIndex.ReadEvent("ABC", 2, out prepare));
        }
Example #9
0
        public void not_find_record_with_index_1_in_second_stream()
        {
            EventRecord record;

            Assert.AreEqual(SingleReadResult.StreamDeleted, ReadIndex.ReadEvent("CD", 1, out record));
        }
Example #10
0
        public void return_stream_deleted_result_for_deleted_event_stream()
        {
            EventRecord prepare;

            Assert.AreEqual(SingleReadResult.StreamDeleted, ReadIndex.ReadEvent("ES", 0, out prepare));
        }
        public void the_second_event_can_be_read()
        {
            var result = ReadIndex.ReadEvent("test2", 0);

            Assert.AreEqual(SingleReadResult.Success, result.Result);
        }
Example #12
0
        public void return_not_found_for_get_record_from_non_existing_stream()
        {
            EventRecord record;

            Assert.AreEqual(SingleReadResult.NoStream, ReadIndex.ReadEvent("ES-NONEXISTING", 0, out record));
        }
Example #13
0
        public void not_find_record_with_non_existing_version_for_event_stream_with_same_hash_as_deleted_one()
        {
            EventRecord prepare;

            Assert.AreEqual(SingleReadResult.NoStream, ReadIndex.ReadEvent("CL", 1, out prepare));
        }
Example #14
0
        public void not_find_record_with_nonexistent_version_for_deleted_event_stream()
        {
            EventRecord prepare;

            Assert.AreEqual(SingleReadResult.StreamDeleted, ReadIndex.ReadEvent("ES", 1, out prepare));
        }
Example #15
0
        public void not_find_last_log_record_for_third_stream()
        {
            var result = ReadIndex.ReadEvent("EF", 6);

            Assert.AreEqual(ReadEventResult.StreamDeleted, result.Result);
        }
Example #16
0
        public void not_find_record_with_index_1_in_third_stream()
        {
            EventRecord record;

            Assert.AreEqual(SingleReadResult.NotFound, ReadIndex.ReadEvent("EF", 1, out record));
        }
Example #17
0
        public void not_find_record_with_version_7_in_third_stream()
        {
            var result = ReadIndex.ReadEvent("EF", 7);

            Assert.AreEqual(ReadEventResult.StreamDeleted, result.Result);
        }
Example #18
0
        public void not_find_record_with_version_3_in_first_stream()
        {
            EventRecord record;

            Assert.AreEqual(SingleReadResult.NotFound, ReadIndex.ReadEvent("AB", 3, out record));
        }
Example #19
0
        public void not_find_record_with_version_5_in_second_stream()
        {
            var result = ReadIndex.ReadEvent("CD", 5);

            Assert.AreEqual(ReadEventResult.NotFound, result.Result);
        }
        public void not_find_record_with_nonexistent_version()
        {
            EventRecord prepare;

            Assert.AreEqual(SingleReadResult.NotFound, ReadIndex.ReadEvent("ES", 3, out prepare));
        }
 public void the_stream_is_absent_logically()
 {
     Assert.AreEqual(ReadEventResult.NoStream, ReadIndex.ReadEvent("test", 0).Result);
     Assert.AreEqual(ReadStreamResult.NoStream, ReadIndex.ReadStreamEventsForward("test", 0, 100).Result);
     Assert.AreEqual(ReadStreamResult.NoStream, ReadIndex.ReadStreamEventsBackward("test", -1, 100).Result);
 }
        public void the_nonexisting_event_can_not_be_read()
        {
            var result = ReadIndex.ReadEvent("test1", 2);

            Assert.AreEqual(ReadEventResult.NotFound, result.Result);
        }
 public void return_not_found_for_get_record_from_non_existing_stream()
 {
     var result = ReadIndex.ReadEvent("ES-NONEXISTING", 0);
     Assert.AreEqual(ReadEventResult.NoStream, result.Result);
     Assert.IsNull(result.Record);
 }
Example #24
0
        public void not_find_log_record_for_nonexistent_stream_with_same_hash()
        {
            EventRecord prepare;

            Assert.AreEqual(SingleReadResult.NoStream, ReadIndex.ReadEvent("EF", 0, out prepare));
        }
 public void not_find_record_with_non_existing_version_for_non_existing_event_stream_with_same_hash_as_stream_with_two_events()
 {
     var result = ReadIndex.ReadEvent("NONE", 2);
     Assert.AreEqual(ReadEventResult.NoStream, result.Result);
     Assert.IsNull(result.Record);
 }
Example #26
0
        public void not_find_log_record_for_first_stream()
        {
            EventRecord prepare;

            Assert.AreEqual(SingleReadResult.StreamDeleted, ReadIndex.ReadEvent("AB", 0, out prepare));
        }
Example #27
0
        public void not_find_record_with_version_5_in_second_stream()
        {
            EventRecord record;

            Assert.AreEqual(SingleReadResult.NotFound, ReadIndex.ReadEvent("CD", 5, out record));
        }
 public void the_kept_stream_is_present()
 {
     Assert.AreEqual(ReadEventResult.Success, ReadIndex.ReadEvent(_keptStream, 0).Result);
     Assert.AreEqual(ReadStreamResult.Success, ReadIndex.ReadStreamEventsForward(_keptStream, 0, 100).Result);
     Assert.AreEqual(ReadStreamResult.Success, ReadIndex.ReadStreamEventsBackward(_keptStream, -1, 100).Result);
 }
Example #29
0
        public void not_find_last_log_record_for_third_stream()
        {
            EventRecord record;

            Assert.AreEqual(SingleReadResult.StreamDeleted, ReadIndex.ReadEvent("EF", 6, out record));
        }
 public void the_metastream_is_absent_logically()
 {
     Assert.AreEqual(ReadEventResult.NotFound, ReadIndex.ReadEvent("$$test", 0).Result);
     Assert.AreEqual(ReadStreamResult.Success, ReadIndex.ReadStreamEventsForward("$$test", 0, 100).Result);
     Assert.AreEqual(ReadStreamResult.Success, ReadIndex.ReadStreamEventsBackward("$$test", -1, 100).Result);
 }