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

            var thingChannelId = new ThingChannelId(new ThingId(new GatewayId(driver, gateway), thing), channel);

            Assert.Equal(thingChannelId.ToString().GetHashCode(), thingChannelId.GetHashCode());
        }
Beispiel #2
0
        public void ToString_CreateId_ResultOk()
        {
            const string driver   = "Driver1";
            const string gateway  = "Gateway1";
            const string thing    = "Thing1";
            const string channel  = "Channel1";
            const string driver2  = "Driver2";
            const string gateway2 = "Gateway2";
            const string thing2   = "Thing2";
            const string channel2 = "Channel2";

            var thingChannelId = new ThingChannelId(new ThingId(new GatewayId(driver, gateway), thing), channel);

            Assert.Equal($"{driver}:{gateway}:{thing}:{channel}", thingChannelId.ToString());

            thingChannelId.Driver  = driver2;
            thingChannelId.Gateway = gateway2;
            thingChannelId.Thing   = thing2;
            thingChannelId.Channel = channel2;

            Assert.Equal($"{driver2}:{gateway2}:{thing2}:{channel2}", thingChannelId.ToString());
        }