예제 #1
0
        public void FireEventFiresEventWithParameterisedArgsPassedByValue()
        {
            var vm = new ViewModelWithEvents();

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

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

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