public void TestFlowSizeOne() { _bufferOne.Add((EventBean[])null); Assert.IsNull(_bufferOne.Get(0)); EventBean[] set1 = Make(2); _bufferOne.Add(set1); Assert.AreSame(set1[1], _bufferOne.Get(0)); TryInvalid(_bufferOne, 1); EventBean[] set2 = Make(1); _bufferOne.Add(set2); Assert.AreSame(set2[0], _bufferOne.Get(0)); TryInvalid(_bufferOne, 1); }
private void AssertEvents(EventBean[] expected, RollingEventBuffer buffer) { for (int i = 0; i < expected.Length; i++) { Assert.AreSame(expected[i], buffer.Get(i)); } TryInvalid(buffer, expected.Length); }
private void TryInvalid(RollingEventBuffer buffer, int index) { try { buffer.Get(index); Assert.Fail(); } catch (ArgumentException) { // expected } }