示例#1
0
 protected RiakClientSetBucketPropertiesTestBase()
 {
     Cluster  = new MockCluster();
     ClientId = System.Text.Encoding.Default.GetBytes("fadjskl").Take(4).ToArray();
     Client   = new RiakClient(Cluster)
     {
         ClientId = ClientId
     };
 }
        protected void SetUp()
        {
            ConnMock          = new Mock <IRiakConnection>();
            ClusterConfigMock = new Mock <IRiakClusterConfiguration>();
            ConnFactoryMock   = new Mock <IRiakConnectionFactory>();
            NodeConfigMock    = new Mock <IRiakNodeConfiguration>();

            ConnFactoryMock.Setup(m => m.CreateConnection(It.IsAny <IRiakNodeConfiguration>())).Returns(ConnMock.Object);
            NodeConfigMock.SetupGet(m => m.PoolSize).Returns(1);
            ClusterConfigMock.SetupGet(m => m.RiakNodes).Returns(new List <IRiakNodeConfiguration>
            {
                NodeConfigMock.Object
            });

            Cluster = new RiakCluster(ClusterConfigMock.Object, ConnFactoryMock.Object);
            Client  = new RiakClient(Cluster);
        }
示例#3
0
        protected void SetUpInternal()
        {
            ConnMock          = new Mock <IRiakConnection>();
            ClusterConfigMock = new Mock <IRiakClusterConfiguration>();
            ConnFactoryMock   = new Mock <IRiakConnectionFactory>();
            NodeConfigMock    = new Mock <IRiakNodeConfiguration>();

            ConnMock.Setup(m => m.PbcWriteRead <TRequest, TResult>(It.IsAny <TRequest>())).Returns(() => Result);
            ConnFactoryMock.Setup(m => m.CreateConnection(It.IsAny <IRiakNodeConfiguration>())).Returns(ConnMock.Object);
            NodeConfigMock.SetupGet(m => m.PoolSize).Returns(1);
            ClusterConfigMock.SetupGet(m => m.RiakNodes).Returns(new List <IRiakNodeConfiguration> {
                NodeConfigMock.Object
            });
            ClusterConfigMock.SetupGet(m => m.DefaultRetryCount).Returns(100);
            ClusterConfigMock.SetupGet(m => m.DefaultRetryWaitTime).Returns(100);

            Cluster = new RiakCluster(ClusterConfigMock.Object, ConnFactoryMock.Object);
            Client  = (RiakClient)Cluster.CreateClient();
        }
示例#4
0
 public ClientTestBase()
 {
     Cluster  = new MockCluster();
     ClientId = System.Text.Encoding.Default.GetBytes("fadjskl").Take(4).ToArray();
     Client   = new RiakClient(Cluster);
 }
 public ClientTestBase()
 {
     Cluster = new MockCluster();
     ClientId = System.Text.Encoding.Default.GetBytes("fadjskl").Take(4).ToArray();
     Client = new RiakClient(Cluster);
 }