示例#1
0
        public void StateExtensions_AddTransition_NullTrigger_ThrowsNullex()
        {
            var machine = new Mock <IStateMachine <StubStateModel> >().Object;
            var toState = new State <StubStateModel>("to");

            Assert.Throws <ArgumentNullException>(() =>
                                                  machine.AddGlobalTransition(null, toState));
        }
示例#2
0
        public void StateExtensions_AddTransition_NullTo_ThrowsNullex()
        {
            var machine = new Mock <IStateMachine <StubStateModel> >().Object;
            var trigger = new Trigger("trigger");

            Assert.Throws <ArgumentNullException>(() =>
                                                  machine.AddGlobalTransition(trigger, null));
        }
示例#3
0
        public void StateExtensions_AddTransition_NullTrigger_WithGuard_ThrowsNullex()
        {
            var machine = new Mock <IStateMachine <StubStateModel> >().Object;
            var toState = new State <StubStateModel>("to");
            Func <StubStateModel, bool> guard = s => true;

            Assert.Throws <ArgumentNullException>(() =>
                                                  machine.AddGlobalTransition(null, toState, guard));
        }