Ejemplo n.º 1
0
        public void FireEventFiresEventWithParameterisedArgsPassedByValue()
        {
            var vm = new ViewModelWithEvents();

            vm.MonitorEvents();
            vm.FireEventWithStringArgsPassingValue("HelloWorld");
            vm.ShouldRaise("EventWithStringArgs").WithArgs <EventArgs <string> >(a => a.Value == "HelloWorld");
        }
Ejemplo n.º 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");
        }