Esempio n. 1
0
        public void ConstructMissing()
        {
            allValues.Clear();
            var       server = InfoTestsHelper.Create("Stats", allValues);
            StatsInfo info   = new StatsInfo(server);

            Assert.IsNull(info.TotalCommands);
        }
Esempio n. 2
0
        public void ConstructMissing()
        {
            allValues.Clear();
            var        server = InfoTestsHelper.Create("Memory", allValues);
            MemoryInfo info   = new MemoryInfo(server);

            Assert.IsNull(info.UsedMemory);
            Assert.IsNull(info.MemoryFragmentation);
        }
Esempio n. 3
0
        public void Construct()
        {
            var server = InfoTestsHelper.Create("Stats", allValues);

            Assert.Throws <ArgumentNullException>(() => new StatsInfo(null));
            StatsInfo info = new StatsInfo(server);

            Assert.AreEqual(100, info.TotalCommands);
        }
        public void ConstructMissing()
        {
            allValues.Clear();
            var             server = InfoTestsHelper.Create("Persistence", allValues);
            PersistenceInfo info   = new PersistenceInfo(server);

            Assert.IsNull(info.AofSize);
            Assert.IsNull(info.IsAofRewriting);
            Assert.IsNull(info.IsRdbSaving);
        }
        public void Construct()
        {
            var server = InfoTestsHelper.Create("Persistence", allValues);

            Assert.Throws <ArgumentNullException>(() => new PersistenceInfo(null));
            PersistenceInfo info = new PersistenceInfo(server);

            Assert.AreEqual(100, info.AofSize);
            Assert.AreEqual(1, info.IsAofRewriting);
            Assert.AreEqual(1, info.IsRdbSaving);
        }
Esempio n. 6
0
        public void Construct()
        {
            var server = InfoTestsHelper.Create("Memory", allValues);

            Assert.Throws <ArgumentNullException>(() => new MemoryInfo(null));
            MemoryInfo info = new MemoryInfo(server);

            Assert.AreEqual(100, info.UsedMemory);
            Assert.AreEqual(0.7, info.MemoryFragmentation);
            Assert.AreEqual(server, info.Main);
        }
        public void ConstructMissing()
        {
            allValues.Clear();
            var             server = InfoTestsHelper.Create("Replication", allValues);
            ReplicationInfo info   = new ReplicationInfo(server);

            Assert.IsNull(info.Role);
            Assert.IsNull(info.LastSync);
            Assert.IsNull(info.MasterLinkStatus);
            Assert.IsNull(info.IsMasterSyncInProgress);
            Assert.IsNull(info.SlaveReplOffset);
        }
        public void Construct()
        {
            var server = InfoTestsHelper.Create("Replication", allValues);

            Assert.Throws <ArgumentNullException>(() => new ReplicationInfo(null));
            ReplicationInfo info = new ReplicationInfo(server);

            Assert.AreEqual(ReplicationRole.Slave, info.Role);
            Assert.AreEqual(MasterLinkStatus.Up, info.MasterLinkStatus);
            Assert.AreEqual(10, info.LastSync);
            Assert.AreEqual(11, info.SlaveReplOffset);
            Assert.AreEqual(1, info.IsMasterSyncInProgress);
            Assert.AreEqual(server, info.Main);
        }