public void SetUp() { var localCounters = new TestCounters(); _counters = localCounters; _pipe = new Aqueduct(); _reader = new AsyncLinesStreamReader(_pipe.Out); _reader.OnError += e => { localCounters.IncrementErrors(); Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); }; _reader.OnChunk += _ => { localCounters.IncrementChunks(); }; _reader.StartReading(); }
public void TestSetUp() { _counters = new TestCounters(); _mreConfig = new ManualResetEventSlim(); _cluster = new CouchbaseCluster(new MemcacheClientConfiguration() { TransportConnectTimerPeriod = Timeout.InfiniteTimeSpan }, "Some.Bucket", new[] { new IPEndPoint(0, 0) }); _cluster.NodeAdded += _ => _counters.IncrementNodesAdded(); _cluster.NodeRemoved += _ => _counters.IncrementNodesRemoved(); _cluster.OnError += e => { _counters.IncrementErrors(); Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); }; _cluster.OnConfig += () => _mreConfig.Set(); }
public void TestSetUp() { _counters = new TestCounters(); _mreConfig = new ManualResetEventSlim(); var config = new MemcacheClientConfiguration() { TransportConnectTimerPeriod = Timeout.InfiniteTimeSpan, NodeFactory = (ipendpoint, _) => new NodeMock { EndPoint = ipendpoint, DefaultResponse = Status.NoError }, }; _cluster = new CouchbaseCluster(config, "Some.Bucket", TimeSpan.FromSeconds(30), new[] { new IPEndPoint(0, 0) }); _cluster.NodeAdded += _ => _counters.IncrementNodesAdded(); _cluster.NodeRemoved += _ => _counters.IncrementNodesRemoved(); _cluster.OnError += e => { _counters.IncrementErrors(); Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); }; _cluster.OnConfig += () => _mreConfig.Set(); }