Exemple #1
0
        public void Can_Create_DiagnosticsReport()
        {
            var report = _cluster.Diagnostics();

            Assert.IsNotNull(report);
            Assert.IsNotEmpty(report.Id);
            Assert.AreEqual(ClientIdentifier.GetClientDescription(), report.Sdk);
            Assert.AreEqual(1, report.Version);

            Assert.IsTrue(report.Services["kv"].Any(e => e.Type == ServiceType.KeyValue)); // at least one KV
            Assert.IsTrue(report.Services["view"].Any(e => e.Type == ServiceType.Views));  // at least one Index
            Assert.IsTrue(report.Services["n1ql"].Any(e => e.Type == ServiceType.Query));  // at least one N1QL

            if (_cluster.GetClusterVersion() >= new ClusterVersion(new Version(5, 0)))
            {
                Assert.IsTrue(report.Services["fts"].Any(e => e.Type == ServiceType.Search));
            }
            if (_cluster.GetClusterVersion() >= new ClusterVersion(new Version(6, 0)))
            {
                Assert.IsFalse(report.Services.ContainsKey("cbas"));
            }
        }