Exemplo n.º 1
0
        public void TestDiscoveryFiltering()
        {
            String expected = "</sensors/light>;if=\"sensor\";rt=\"light-lux\"";

            Request request = Request.NewGet();
            request.SetUri("/.well-known/core?rt=light-lux");

            DiscoveryResource discovery = new DiscoveryResource(_root);
            String serialized = LinkFormat.Serialize(_root, request.UriQueries);
            Assert.AreEqual(expected, serialized);
        }
Exemplo n.º 2
0
        public void TestDiscovery()
        {
            String expected = "</sensors>;title=\"Sensor Index\"," +
                    "</sensors/light>;if=\"sensor\";rt=\"light-lux\"," +
                    "</sensors/temp>;bar=\"one two\";foo;if=\"sensor\";rt=\"temperature-c\"";
            DiscoveryResource discovery = new DiscoveryResource(_root);
            String serialized = LinkFormat.Serialize(_root);
            Assert.AreEqual(expected, serialized);

            serialized = LinkFormat.Serialize(_root, new List<String>());
            Assert.AreEqual(expected, serialized);
        }