Exemplo n.º 1
0
        public void TestStringOutput()
        {
            var    control = new DummyControl();
            string output  = control.Execute();

            output.Length.Should().BeGreaterThan(1);
        }
            public DummyControlEventSink(DummyControl dummyControl)
            {
                if (dummyControl == null)
                {
                    Assert.Fail("dummyControl cannot be null.");
                }

                dummyControl.Started += delegate(object sender, EventArgs e)
                {
                    _startedCallsCount.Inc();
                    _sender.Actual = sender;
                };

                dummyControl.StartedCustomHandler += delegate
                {
                };

                dummyControl.StartedInvalidHandler += delegate
                {
                };

                dummyControl.StartedInvalidParamCountHandler += delegate
                {
                };
            }
Exemplo n.º 3
0
        public void PropertyLambaMustNotBeAMethodCall()
        {
            var dummyControl   = new DummyControl();
            var dummyViewModel = new DummyViewModel();
            var ex             = Record.Exception(() => dummyControl.Bind(_ => _.ToString(), dummyViewModel, _ => _.ToString()));

            Assert.NotNull(ex);
            Assert.Equal(string.Format(Extensions.EXPRESSION_REFERS_METHOD, "_ => _.ToString()"), ex.Message);
        }
Exemplo n.º 4
0
        public void PropertyLambaMustNotBeAField()
        {
            var dummyControl   = new DummyControl();
            var dummyViewModel = new DummyViewModel();
            var ex             = Record.Exception(() => dummyControl.Bind(_ => _.DummyString, dummyViewModel, _ => _._DummyString));

            Assert.NotNull(ex);
            Assert.Equal(string.Format(Extensions.EXPRESSION_REFERS_FIELD, "_ => _.DummyString"), ex.Message);
        }
            public DummyControlEventSink(DummyControl dummyControl)
            {
                if (dummyControl == null)
                {
                    Assert.Fail("dummyControl cannot be null.");
                }

                dummyControl.StartedGeneric += delegate(object sender, EventArgs e)
                {
                    this.startedGenericCallsCount.Inc();
                    this.senderGeneric.Actual = sender;
                };

                dummyControl.Started += delegate(object sender, EventArgs e)
                {
                    this.startedCallsCount.Inc();
                    this.sender.Actual = sender;
                };

                dummyControl.MouseAction += delegate(object sender, MouseEventArgs e)
                {
                    this.startedMouseCallsCount.Inc();
                    this.startedMouseSender.Actual    = sender;
                    this.startedMouseEventArgs.Actual = e;
                };

                dummyControl.StartedCustomHandler += delegate
                {
                };

                dummyControl.StartedGenericCustomHandler += delegate
                {
                };

                dummyControl.MouseActionCustomHandler += delegate
                {
                };

                dummyControl.PropertyChanged += delegate
                {
                    this.propertyChangedCallsCount.Inc();
                };

                dummyControl.PropertyChangedCustomHandler += delegate
                {
                };
            }
            public DummyControlEventSink(DummyControl dummyControl)
            {
                Assert.IsNotNull(dummyControl);

                dummyControl.Started += delegate(Object sender, EventArgs e)
                {
                    _startedCallsCount.Inc();
                    _sender.Actual = sender;
                };

                dummyControl.StartedCustomHandler += delegate
                {
                };

                dummyControl.StartedInvalidHandler += delegate
                {
                };

                dummyControl.StartedInvalidParamCountHandler += delegate
                {
                };
            }
Exemplo n.º 7
0
 public void SetUp()
 {
     _ctrl      = new DummyControl();
     _eventSink = new DummyControlEventSink(_ctrl);
 }
			public DummyControlEventSink(DummyControl dummyControl)
			{
				if (dummyControl == null)
				{
					Assert.Fail("dummyControl cannot be null.");
				}

				dummyControl.Started += delegate(object sender, EventArgs e)
				{
					_startedCallsCount.Inc();
					_sender.Actual = sender;
				};

				dummyControl.StartedCustomHandler += delegate
				{
				};

				dummyControl.StartedInvalidHandler += delegate
				{
				};

				dummyControl.StartedInvalidParamCountHandler += delegate
				{
				};
			}
			public DummyControlEventSink(DummyControl dummyControl)
			{
				if (dummyControl == null)
				{
					Assert.Fail("dummyControl cannot be null.");
				}

				dummyControl.StartedGeneric += delegate(object sender, EventArgs e)
				{
					this.startedGenericCallsCount.Inc();
					this.senderGeneric.Actual = sender;
				};

				dummyControl.Started += delegate(object sender, EventArgs e)
				{
					this.startedCallsCount.Inc();
					this.sender.Actual = sender;
				};

				dummyControl.MouseAction += delegate(object sender, MouseEventArgs e)
				{
					this.startedMouseCallsCount.Inc();
					this.startedMouseSender.Actual = sender;
					this.startedMouseEventArgs.Actual = e;
				};

				dummyControl.StartedCustomHandler += delegate
				{
				};

				dummyControl.StartedGenericCustomHandler += delegate
				{
				};

				dummyControl.MouseActionCustomHandler += delegate
				{
				};

				dummyControl.PropertyChanged += delegate
				{
					this.propertyChangedCallsCount.Inc();
				};

				dummyControl.PropertyChangedCustomHandler += delegate
				{
				};
			}
Exemplo n.º 10
0
 public void TestStringOutput()
 {
     var control = new DummyControl();
     string output = control.Execute();
     output.Length.Should().BeGreaterThan(1);
 }
			public DummyControlEventSink(DummyControl dummyControl)
			{
				Assert.IsNotNull(dummyControl);

				dummyControl.Started += delegate(Object sender, EventArgs e)
				{
					_startedCallsCount.Inc();
					_sender.Actual = sender;
				};

				dummyControl.StartedCustomHandler += delegate
				{
				};

				dummyControl.StartedInvalidHandler += delegate
				{
				};

				dummyControl.StartedInvalidParamCountHandler += delegate
				{
				};
			}
		public void SetUp()
		{
			_ctrl = new DummyControl();
			_eventSink = new DummyControlEventSink(_ctrl);
		}