示例#1
0
        public void TestEquals()
        {
            IDictionary <String, Object> otherProperties = new Dictionary <String, Object>(_properties);
            EventTypeMetadata            meta            = EventTypeMetadata.CreateWrapper("test", true, false, false);
            EventTypeSPI otherType = new WrapperEventType(meta, "mytype", 1, _underlyingEventTypeOne, otherProperties, _eventAdapterService);

            Assert.IsTrue(_eventType.EqualsCompareType(otherType));
            Assert.IsTrue(otherType.EqualsCompareType(_eventType));

            otherType = new WrapperEventType(meta, "mytype", 1, _underlyingEventTypeTwo, otherProperties, _eventAdapterService);
            Assert.IsFalse(_eventType.EqualsCompareType(otherType));
            Assert.IsFalse(otherType.EqualsCompareType(_eventType));

            otherProperties["anotherProperty"] = typeof(int);
            otherType = new WrapperEventType(meta, "mytype", 1, _underlyingEventTypeOne, otherProperties, _eventAdapterService);
            Assert.IsFalse(_eventType.EqualsCompareType(otherType));
            Assert.IsFalse(otherType.EqualsCompareType(_eventType));

            otherType = (EventTypeSPI)_underlyingEventTypeOne;
            Assert.IsFalse(_eventType.EqualsCompareType(otherType));
            Assert.IsFalse(otherType.EqualsCompareType(_eventType));
        }