Beispiel #1
0
        public void Equals_SameId_ReturnsTrue()
        {
            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.True(thingChannelId.Equals(thingChannelId));
        }
Beispiel #2
0
        public void Equals_NullId_ReturnsFalse()
        {
            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.False(thingChannelId.Equals((IdBase)null));
        }
Beispiel #3
0
        public void Equals_NotSameIdString_ReturnsFalse()
        {
            const string driver  = "Driver1";
            const string gateway = "Gateway1";
            const string thing   = "Thing1";
            const string channel = "Channel1";
            const string driver2 = "Driver2";

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

            Assert.False(thingChannelId.Equals($"{driver2}:{gateway}:{thing}:{channel}"));
        }
Beispiel #4
0
        public void Equals_SameIdStringObject_ReturnsTrue()
        {
            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);

            object id = $"{driver}:{gateway}:{thing}:{channel}";

            Assert.True(thingChannelId.Equals(id));
        }
Beispiel #5
0
        public void Equals_OtherIdWithSameValueObject_ReturnsTrue()
        {
            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);
            var thingChannelId2 = new ThingChannelId(new ThingId(new GatewayId(driver, gateway), thing), channel);

            object id = thingChannelId2;

            Assert.True(thingChannelId.Equals(id));
        }