Ejemplo n.º 1
0
        public void ToString_CreateId_ResultOk()
        {
            const string driver   = "Driver1";
            const string gateway  = "Gateway1";
            const string thing    = "Thing1";
            const string driver2  = "Driver2";
            const string gateway2 = "Gateway2";
            const string thing2   = "Thing2";

            var thingId = new ThingId(new GatewayId(driver, gateway), thing);

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

            thingId.Driver  = driver2;
            thingId.Gateway = gateway2;
            thingId.Thing   = thing2;

            Assert.Equal($"{driver2}:{gateway2}:{thing2}", thingId.ToString());
        }
Ejemplo n.º 2
0
        public void GetHashCode_ThingId_EqualsIdStringHashCode()
        {
            const string driver  = "Driver1";
            const string gateway = "Gateway1";
            const string thing   = "Thing1";

            var thingId = new ThingId(new GatewayId(driver, gateway), thing);

            Assert.Equal(thingId.ToString().GetHashCode(), thingId.GetHashCode());
        }