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

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

            vm.EventWithStringArgs += (s, e) => e.Value = "FooBar";
            var args = vm.FireEventWithStringArgs("HelloWorld");

            args.Value.Should().Be("FooBar");
        }