Exemplo n.º 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"));
        }
Exemplo n.º 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);
        }