public void propertyChangedMonitor_Observe_using_observable_property_should_behave_as_expected()
		{
			var expected = 1;
			var actual = 0;

			var stub = new TestStub();
			var target = new PropertyChangedMonitor<TestStub>( stub );
			target.Observe( stub.Text );
			target.Changed += ( s, e ) => actual++;

			stub.Text.Value = "Hello!";

			actual.Should().Be.EqualTo( expected );
		}
Example #2
0
        public void propertyChangedMonitor_ForAllProperties_using_clr_property_should_behave_as_expected()
        {
            var expected = 1;
            var actual   = 0;

            var stub   = new TestStub();
            var target = new PropertyChangedMonitor(stub);

            target.Changed += (s, e) => actual++;

            stub.Value = "Hello!";

            actual.Should().Be.EqualTo(expected);
        }
Example #3
0
        public void propertyChangedMonitor_Observe_using_observable_property_should_behave_as_expected()
        {
            var expected = 1;
            var actual   = 0;

            var stub   = new TestStub();
            var target = new PropertyChangedMonitor <TestStub>(stub);

            target.Observe(stub.Text);
            target.Changed += (s, e) => actual++;

            stub.Text.Value = "Hello!";

            actual.Should().Be.EqualTo(expected);
        }
        public void delegateCommand_trigger_using_PropertyObserver_ForAllproperties_should_trigger_canExecuteChanged()
        {
            var expected = 2;
            var actual   = 0;

            var stub = new TestStub();

            var target = DelegateCommand.Create().Observe(stub);

            target.CanExecuteChanged += (s, e) => actual++;

            stub.Value        = "this raises PropertyChanged";
            stub.AnotherValue = "this raises PropertyChanged";

            actual.Should().Be.EqualTo(expected);
        }
Example #5
0
        public MainPage()
        {
            this.InitializeComponent();

            ActivityUpdateTimer_Start();

            if (Application.Current as App != null)
            {
                _logger = ((App)Application.Current).logger;
            }

            Application.Current.Suspending += Application_Suspending;
            Application.Current.Resuming   += Application_Resuming;

            _cdDevice = new ContinuousData(Dispatcher, _logger);
            _crDevice = new CommandResponse(Dispatcher, _logger);
            _tsDevice = new TestStub(Dispatcher, _logger);


            _ = Dispatcher.RunAsync(CoreDispatcherPriority.Low, EnumerateSerialDevices);
        }
		public void propertyChangedMonitor_ForAllProperties_using_clr_property_should_behave_as_expected()
		{
			var expected = 1;
			var actual = 0;

			var stub = new TestStub();
			var target = new PropertyChangedMonitor( stub );
			target.Changed += ( s, e ) => actual++;

			stub.Value = "Hello!";

			actual.Should().Be.EqualTo( expected );
		}
		public void delegateCommand_trigger_using_PropertyObserver_ForAllproperties_should_trigger_canExecuteChanged()
		{
			var expected = 2;
			var actual = 0;

			var stub = new TestStub();

			var target = DelegateCommand.Create().Observe( stub );
			target.CanExecuteChanged += ( s, e ) => actual++;

			stub.Value = "this raises PropertyChanged";
			stub.AnotherValue = "this raises PropertyChanged";

			actual.Should().Be.EqualTo( expected );
		}
Example #8
0
 public TestStubDependency(TestStub stub)
 {
     Stub = stub;
 }