示例#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));
        }
 /// <summary>Ctor. </summary>
 /// <param name="wrapperEventType">wrapper type</param>
 /// <param name="eventAdapterService">for creating events</param>
 /// <param name="underlyingCopyMethod">for copying the underlying event</param>
 public WrapperEventBeanUndCopyMethod(WrapperEventType wrapperEventType, EventAdapterService eventAdapterService, EventBeanCopyMethod underlyingCopyMethod)
 {
     _wrapperEventType     = wrapperEventType;
     _eventAdapterService  = eventAdapterService;
     _underlyingCopyMethod = underlyingCopyMethod;
 }
 /// <summary>Ctor. </summary>
 /// <param name="wrapperEventType">wrapper type</param>
 /// <param name="eventAdapterService">event adapter</param>
 public WrapperEventBeanMapCopyMethod(WrapperEventType wrapperEventType, EventAdapterService eventAdapterService)
 {
     _wrapperEventType    = wrapperEventType;
     _eventAdapterService = eventAdapterService;
 }