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

            Assert.Throws <FormatException>(() => ThingId.Parse($"{driver}:{gateway}:{thing}:1"));
        }
Exemple #2
0
        public void Parse_ValidIdString_ReturnsThingId()
        {
            const string driver  = "Driver1";
            const string gateway = "Gateway1";
            const string thing   = "Thing1";

            var thingId = ThingId.Parse($"{driver}:{gateway}:{thing}");

            Assert.Equal(driver, thingId.Driver);
            Assert.Equal(gateway, thingId.Gateway);
            Assert.Equal(thing, thingId.Thing);
        }