コード例 #1
0
        public void TestServerSend(int id, int channel)
        {
            byte[]              array   = new byte[10];
            const int           offset  = 2;
            const int           count   = 5;
            ArraySegment <byte> segment = new ArraySegment <byte>(array, offset, count);

            middleware.ServerSend(id, channel, segment);

            inner.Received(1).ServerSend(id, channel, Arg.Is <ArraySegment <byte> >(x => x.Array == array && x.Offset == offset && x.Count == count));
            // only need to check first arg,
            inner.Received(0).ServerSend(Arg.Is <int>(x => x != id), Arg.Any <int>(), Arg.Any <ArraySegment <byte> >());
        }