public void NoOpRequestFailTest() { Status status = Status.UnknownCommand; var request = new NoOpRequest { Callback = (h) => status = h.Status, }; var queryBuffer = request.GetQueryBuffer(); var header = new MemcacheResponseHeader { Opcode = Opcode.NoOp, Status = Status.NoError }; Assert.DoesNotThrow(request.Fail); Assert.AreEqual(Status.InternalError, status); }
public void NoOpRequestOkTest() { Status status = Status.UnknownCommand; var request = new NoOpRequest { Callback = (h) => status = h.Status, }; var queryBuffer = request.GetQueryBuffer(); Assert.IsNotNull(queryBuffer); CollectionAssert.AreEqual(NOOP_QUERY, queryBuffer, "The noop query buffer is different of the expected one"); var header = new MemcacheResponseHeader { Opcode = Opcode.NoOp, Status = Status.NoError }; Assert.DoesNotThrow(() => request.HandleResponse(header, null, null, null)); Assert.AreEqual(Status.NoError, status); }