Beispiel #1
0
        public void Parse_InvalidIdString_ThrowsException()
        {
            const string driver  = "Driver1";
            const string gateway = "Gateway1";
            const string thing   = "Thing1";
            const string channel = "Channel1";

            Assert.Throws <FormatException>(() => ThingChannelId.Parse($"{driver}:{gateway}:{thing}:{channel}:1"));
        }
Beispiel #2
0
        public void Parse_ValidIdString_ReturnsThingChannelId()
        {
            const string driver  = "Driver1";
            const string gateway = "Gateway1";
            const string thing   = "Thing1";
            const string channel = "Channel1";

            var thingChannelId = ThingChannelId.Parse($"{driver}:{gateway}:{thing}:{channel}");

            Assert.Equal(driver, thingChannelId.Driver);
            Assert.Equal(gateway, thingChannelId.Gateway);
            Assert.Equal(thing, thingChannelId.Thing);
            Assert.Equal(channel, thingChannelId.Channel);
        }