Example #1
0
        public void IsBusyDoesntRaisePropertyChangeIfTheValueDoesntChange()
        {
            var vm = new ViewModelWithEvents();

            vm.MonitorEvents();
            vm.IsBusy = false;
            vm.ShouldNotRaisePropertyChangeFor(v => v.IsBusy);
        }
Example #2
0
        public void FireEventFiresEventWithBasicArgs()
        {
            var vm = new ViewModelWithEvents();

            vm.MonitorEvents();
            vm.FireEventWithBasicArgs();
            vm.ShouldRaise("EventWithBasicArgs").WithArgs <MyEventArgs>(a => true);
        }
Example #3
0
        public void FireEventFiresEventWithParameterisedArgsPassedByValue()
        {
            var vm = new ViewModelWithEvents();

            vm.MonitorEvents();
            vm.FireEventWithStringArgsPassingValue("HelloWorld");
            vm.ShouldRaise("EventWithStringArgs").WithArgs <EventArgs <string> >(a => a.Value == "HelloWorld");
        }
Example #4
0
        public void FireEventFiresEventWithNoArgs()
        {
            var vm = new ViewModelWithEvents();

            vm.MonitorEvents();
            vm.FireEventWithNoArgs();
            vm.ShouldRaise("EventWithNoArgs").WithArgs <EventArgs>(a => a == EventArgs.Empty);
        }
Example #5
0
        public async Task BusyIndicatorRaisesPropertyChangeAfterRunAction()
        {
            var vm = new ViewModelWithEvents();

#pragma warning disable 1998
            await vm.RunWithBusyIndicatorAsync(async() => vm.MonitorEvents());

#pragma warning restore 1998
            vm.ShouldRaisePropertyChangeFor(v => v.IsBusy);
        }