public GXEchoResponse Delete(GXEchoRequest request) { GXEchoResponse res = new GXEchoResponse(); res.Id = request.Id; return(res); }
public void ArgumentOutOfRangeExceptionTest() { GXJsonClient cl = new GXJsonClient("http://localhost:6786/"); GXEchoRequest expected = new GXEchoRequest(); expected.Id = -1; GXEchoResponse actual = cl.Put(expected); }
public void AuthenticationFailureTest() { GXJsonClient cl = new GXJsonClient("http://localhost:6786/"); GXEchoRequest expected = new GXEchoRequest(); expected.Id = new Random().Next(); GXEchoResponse actual = cl.Delete(expected); Assert.AreEqual(expected.Id, actual.Id); }
public void PutTest() { GXJsonClient cl = new GXJsonClient("http://localhost:6786/"); GXEchoRequest expected = new GXEchoRequest(); expected.Id = new Random().Next(); GXEchoResponse actual = cl.Put(expected); Assert.AreEqual(expected.Id, actual.Id); }
public GXEchoResponse Put(GXEchoRequest request) { GXEchoResponse res = new GXEchoResponse(); if (request.Id == -1) { throw new ArgumentOutOfRangeException("Put"); } res.Id = request.Id; return(res); }
public void DeleteTest() { Server.Close(); Server = new GXAuthenticationServer("http://localhost:6786/"); GXJsonClient cl = new GXJsonClient("http://localhost:6786/", "Gurux", "Gurux"); GXEchoRequest expected = new GXEchoRequest(); expected.Id = new Random().Next(); GXEchoResponse actual = cl.Delete(expected); Assert.AreEqual(expected.Id, actual.Id); }