コード例 #1
0
        public void SetDocument()
        {
            var device = new StringDiscoveryDevice
            {
                Document = "test document, should be json, but for the test it doesn't matter"
            };

            Assert.IsNotNull(device.Document);
            Assert.AreEqual("test document, should be json, but for the test it doesn't matter", device.Document);
        }
コード例 #2
0
        /// <summary>
        /// Discovers the service described by the specified json
        /// </summary>
        protected static IService GetService(string discoveryJson)
        {
            // Create the discovery document fetcher.
            var device = new StringDiscoveryDevice {
                Document = discoveryJson
            };

            // Discover the service using the hand-coded discovery service.
            var discovery = new DiscoveryService(device);

            return(discovery.GetService(DiscoveryVersion.Version_1_0));
        }