public void When_BucketConfig_Has_Replicas_VBucketKeyMapper_Replica_Count_Is_Equal() { var json = ResourceHelper.ReadResource(@"Data\Configuration\config-with-replicas-complete.json"); var bucketConfig = JsonConvert.DeserializeObject <BucketConfig>(json); var servers = new Dictionary <IPEndPoint, IServer>(); foreach (var node in bucketConfig.GetNodes()) { servers.Add(new IPEndPoint(node.GetIPAddress(), 8091), new Server(new FakeIOService(node.GetIPEndPoint(), new FakeConnectionPool(), false), node, new ClientConfiguration(), bucketConfig, new FakeTranscoder())); } var mapper = new VBucketKeyMapper(servers, bucketConfig.VBucketServerMap, bucketConfig.Rev, bucketConfig.Name); var vBucket = (IVBucket)mapper.MapKey("somekey"); const int expected = 3; Assert.AreEqual(expected, vBucket.Replicas.Count()); }