Exemplo n.º 1
0
 public void TearDown()
 {
     _appendOnlyStore.Close();
     if (Directory.Exists(_path))
     {
         Directory.Delete(_path, true);
     }
 }
Exemplo n.º 2
0
        public void SetUp()
        {
            _serializer = new TestMessageSerializer(new[] { typeof(SerializerTest1), typeof(SerializerTest2), typeof(string) });
            _path       = Path.Combine(Path.GetTempPath(), "MessageStore", Guid.NewGuid().ToString());
            if (!Directory.Exists(_path))
            {
                Directory.CreateDirectory(_path);
            }
            _appendOnlyStore = new FileAppendOnlyStore(new DirectoryInfo(_path));

            var store = new MessageStore(_appendOnlyStore, _serializer);

            store.AppendToStore("stream1", MessageAttribute.Empty, -1, new[] { new SerializerTest1("msg1") });
            store.AppendToStore("stream2", MessageAttribute.Empty, -1, new[] { new SerializerTest1("msg1"), new SerializerTest1("msg2") });
            store.AppendToStore("stream3", MessageAttribute.Empty, -1, new[] { new SerializerTest1("msg1"), new SerializerTest1("msg2"), new SerializerTest1("msg3") });
            store.RecordMessage("stream4", new ImmutableEnvelope("EnvId", DateTime.UtcNow, new SerializerTest1("msg1"), MessageAttribute.Empty));

            _appendOnlyStore.Close();
            _appendOnlyStore = new FileAppendOnlyStore(new DirectoryInfo(_path));
            _appendOnlyStore.Initialize();

            _store = new MessageStore(_appendOnlyStore, _serializer);
        }
 public void Teardown()
 {
     _store.ResetStore();
     _store.Close();
 }
 public void Teardown()
 {
     _appendOnlyStore.Close();
     Directory.Delete(_path, true);
 }