コード例 #1
0
        public void DisagreeingValues()
        {
            const string name = "name";
            var          info = new Mock <IEventInfo> ();

            info.SetupGet(i => i.Name).Returns(name);

            var editor = new MockObjectEditor {
                Events = new[] { info.Object }
            };
            const string handler = "handler";

            editor.AttachHandlerAsync(info.Object, handler);

            var editor2 = new MockObjectEditor {
                Events = new[] { info.Object }
            };

            editor.AttachHandlerAsync(info.Object, "handler2");

            var ev = new EventViewModel(MockEditorProvider.MockPlatform, info.Object, new[] { editor, editor2 });

            Assert.That(ev.MethodName, Is.Null);
            Assert.That(ev.MultipleValues, Is.True);
        }
コード例 #2
0
        public void MethodName()
        {
            const string name = "name";
            var          info = new Mock <IEventInfo> ();

            info.SetupGet(i => i.Name).Returns(name);

            var editor = new MockObjectEditor {
                Events = new[] { info.Object }
            };
            const string handler = "handler";

            editor.AttachHandlerAsync(info.Object, handler);

            var ev = new EventViewModel(MockEditorProvider.MockPlatform, info.Object, new[] { editor });

            Assert.That(ev.MethodName, Is.EqualTo(handler));
        }