public void SetUp() { _buffer = Substitute.For <IUnsafeBuffer>(); _buffer.Size.Returns(TotalBufferLength); _buffer.GetAtomicLong(Arg.Any <long>()).Returns(ci => new AtomicLong((byte *)ci.Arg <long>())); _buffer.GetAtomicInt(Arg.Any <long>()).Returns(ci => new AtomicInt((byte *)ci.Arg <long>())); _atomicLong = Substitute.For <Mocks.IAtomicLong>(); Mocks.AtomicLong = _atomicLong; _atomicInt = Substitute.For <Mocks.IAtomicInt>(); Mocks.AtomicInt = _atomicInt; _ringBuffer = new ManyToOneRingBuffer(_buffer); }
public void SetUp() { _buffer = Substitute.For<IUnsafeBuffer>(); _buffer.Size.Returns(TotalBufferLength); _buffer.GetAtomicLong(Arg.Any<long>()).Returns(ci => new AtomicLong((byte*) ci.Arg<long>())); _buffer.GetAtomicInt(Arg.Any<long>()).Returns(ci => new AtomicInt((byte*) ci.Arg<long>())); _atomicLong = Substitute.For<Mocks.IAtomicLong>(); Mocks.AtomicLong = _atomicLong; _atomicInt = Substitute.For<Mocks.IAtomicInt>(); Mocks.AtomicInt = _atomicInt; _ringBuffer = new OneToOneRingBuffer(_buffer); }