public void TestConfirmable()
{
// send request
Request req2acc = new Request(Method.POST, true);
req2acc.SetUri("localhost:" + _serverPort + "/" + ACC_RESOURCE);
req2acc.SetPayload("client says hi");
req2acc.Send();
// receive response and check
Response response = req2acc.WaitForResponse(100);
Assert.IsNotNull(response);
Assert.AreEqual(response.PayloadString, SERVER_RESPONSE);
Assert.AreEqual(response.Type, MessageType.CON);
Request req2noacc = new Request(Method.POST, true);
req2noacc.SetUri("coap://localhost:" + _serverPort + "/" + NO_ACC_RESOURCE);
req2noacc.SetPayload("client says hi");
req2noacc.Send();
// receive response and check
response = req2noacc.WaitForResponse(100);
Assert.IsNotNull(response);
Assert.AreEqual(response.PayloadString, SERVER_RESPONSE);
Assert.AreEqual(response.Type, MessageType.ACK);
}