Exemple #1
0
 static LiveRiakConnectionTestBase()
 {
     ClientId = RiakConnection.ToClientId(TestClientId);
     TestJson = new { @string = "value", @int = 100, @float = 2.34, array = new[] { 1, 2, 3 }, dict = new Dictionary <string, string> {
                          { "foo", "bar" }
                      } }.ToJson();
 }
 public RiakConnection AddConnection(string host, int port)
 {
     var c = new RiakConnection {
         Host = host, 
         Port = port
     };
     _connections.Add(c);
     return c;
 }
 public void ShouldPing()
 {
     // Arrange.
     var connection = new RiakConnection { Host = "192.168.30.118", Port = 8087 };
     var repository = new RiakManagementRepository(connection);
     
     // Act.
     repository.Ping();
 }
        public void ShouldPersistClientId()
        {
            // Arrange.
            var connection = new RiakConnection { Host = "192.168.30.118", Port = 8087 };
            var repository = new RiakManagementRepository(connection);

            // Act.
            var response = repository.PersistClientId(new PersistClientIdRequest {ClientId = BitConverter.GetBytes(1337)});

            // Assert.
            Assert.IsTrue(response.ResponseCode == RiakResponseCode.Successful);
        }
        public void ShouldFindClientId()
        {
            // Arrange.
            var connection = new RiakConnection { Host = "192.168.30.118", Port = 8087 };
            var repository = new RiakManagementRepository(connection);

            // Act.


            // Assert.
            Assert.IsTrue(true);
        }
        public void ShouldGetServerInformation()
        {
            // Arrange.
            var connection = new RiakConnection { Host = "192.168.30.118", Port = 8087 };
            var repository = new RiakManagementRepository(connection);

            // Act.
            var response = repository.GetServerInformation();

            // Assert.
            Assert.IsTrue(response.ResponseCode == RiakResponseCode.Successful);
            Assert.IsNotNull(response.Result);
            Assert.IsNotNull(response.Result.Node);
            Assert.IsNotNull(response.Result.ServerVersion);
        }
 public RiakManagementRepository(RiakConnection connection)
 {
     Connection = connection;
 }