コード例 #1
0
ファイル: Inverter.cs プロジェクト: xyfc/Yggdrasil
        public void Inverter()
        {
            var state = new State();
            var test  = 0;

            var routine = new Inverter(new Conditional((_) => test < 50));

            for (; test < 50; ++test)
            {
                Assert.Equal(RoutineStatus.Failure, routine.Act(state));
                state.Reset();
            }

            test++;
            Assert.Equal(RoutineStatus.Success, routine.Act(state));
            state.Reset();

            Assert.Equal(RoutineStatus.Success, routine.Act(state));
            state.Reset();

            test = 1;
            Assert.Equal(RoutineStatus.Failure, routine.Act(state));
            state.Reset();
        }