示例#1
0
        public void SentinelMastersTest()
        {
            var masterConfigs = SentinelServerA.SentinelMasters();

            Assert.Single(masterConfigs);
            Assert.True(masterConfigs[0].ToDictionary().ContainsKey("name"));
            Assert.Equal(ServiceName, masterConfigs[0].ToDictionary()["name"]);
            Assert.StartsWith("master", masterConfigs[0].ToDictionary()["flags"]);
            foreach (var config in masterConfigs)
            {
                foreach (var kvp in config)
                {
                    Log("{0}:{1}", kvp.Key, kvp.Value);
                }
            }
        }
示例#2
0
        public void SentinelPrimariesTest()
        {
            var primaryConfigs = SentinelServerA.SentinelMasters();

            Assert.Single(primaryConfigs);
            Assert.True(primaryConfigs[0].ToDictionary().ContainsKey("name"), "replicaConfigs contains 'name'");
            Assert.Equal(ServiceName, primaryConfigs[0].ToDictionary()["name"]);
            Assert.StartsWith("master", primaryConfigs[0].ToDictionary()["flags"]);
            foreach (var config in primaryConfigs)
            {
                foreach (var kvp in config)
                {
                    Log("{0}:{1}", kvp.Key, kvp.Value);
                }
            }
        }