public void ClientSetNameTest() { string reply = "+OK\r\n"; using (var mock = new FakeRedisSocket(reply, reply)) using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999))) { Assert.AreEqual("OK", redis.ClientSetName("myname")); Assert.AreEqual("*3\r\n$6\r\nCLIENT\r\n$7\r\nSETNAME\r\n$6\r\nmyname\r\n", mock.GetMessage()); } }
public void ClientSetNameTest() { string reply = "+OK\r\n"; using (var mock = new MockConnector("MockHost", 9999, reply, reply)) using (var redis = new RedisClient(mock)) { Assert.AreEqual("OK", redis.ClientSetName("myname")); Assert.AreEqual("*3\r\n$6\r\nCLIENT\r\n$7\r\nSETNAME\r\n$6\r\nmyname\r\n", mock.GetMessage()); } }
public void ClientSetNameTest() { string reply = "+OK\r\n"; using(var mock = new MockConnector("localhost", 9999, reply, reply)) using(var redis = new RedisClient(mock)) { Assert.True(redis.ClientSetName("myname")); Assert.Equal("*3\r\n$6\r\nCLIENT\r\n$7\r\nSETNAME\r\n$6\r\nmyname\r\n", mock.GetMessage()); } }
public void ClientSetNameTest() { string reply = "+OK\r\n"; using (var mock = new FakeRedisSocket(reply, reply)) using (var redis = new RedisClient(mock, new DnsEndPoint("fakehost", 9999))) { Assert.AreEqual("OK", redis.ClientSetName("myname")); Assert.AreEqual("*3\r\n$6\r\nCLIENT\r\n$7\r\nSETNAME\r\n$6\r\nmyname\r\n", mock.GetMessage()); } }