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

            var parseOk = ThingId.TryParse($"{driver}:{gateway}:{thing}:1", out var thingId);

            Assert.False(parseOk);
            Assert.Null(thingId);
        }
Example #2
0
        public void TryParse_ValidIdString_ReturnsTrueAndOutThingId()
        {
            const string driver  = "Driver1";
            const string gateway = "Gateway1";
            const string thing   = "Thing1";

            var parseOk = ThingId.TryParse($"{driver}:{gateway}:{thing}", out var thingId);

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