public void CanGetSampleDeclaration()
        {
            Discoverator discoverator = new Discoverator();

            Stream stream = discoverator.GetServiceDetails(_TestDomain, new Uri("http://mockhost"), "v1/rest");
            StreamReader reader = new StreamReader(stream);
            string str = reader.ReadToEnd();
            Assert.IsFalse(string.IsNullOrEmpty(str));

            var obj = JObject.Parse(str);
            Assert.AreEqual("1.2", obj["swaggerVersion"]);
            Assert.AreEqual("1.0.0.0", obj["apiVersion"]);
            Assert.AreEqual("http://mockhost", obj["basePath"]);
            Assert.AreEqual("/v1/rest", obj["resourcePath"]);
            Assert.IsTrue(obj["apis"].HasValues);

            var api = obj["apis"][0];
            Assert.AreEqual("/v1/rest/data", api["path"]);
        }
Beispiel #2
0
        public void CanGetSampleDeclaration()
        {
            Discoverator discoverator = new Discoverator();

            Stream       stream = discoverator.GetServiceDetails(_TestDomain, new Uri("http://mockhost"), "v1/rest");
            StreamReader reader = new StreamReader(stream);
            string       str    = reader.ReadToEnd();

            Assert.IsFalse(string.IsNullOrEmpty(str));

            var obj = JObject.Parse(str);

            Assert.AreEqual("1.2", obj["swaggerVersion"]);
            Assert.AreEqual("1.0.0.0", obj["apiVersion"]);
            Assert.AreEqual("http://mockhost", obj["basePath"]);
            Assert.AreEqual("/v1/rest", obj["resourcePath"]);
            Assert.IsTrue(obj["apis"].HasValues);

            var api = obj["apis"][0];

            Assert.AreEqual("/v1/rest/data", api["path"]);
        }