Beispiel #1
0
        public async Task ShouldUseFallbackGoal()
        {
            var goal = new TestGoal{Weight = 1};
            var planner = PlannerFactory.CreatePlanner();
            var agent = new FallbackAgent(planner, goal);

            await Assert.ThrowsAsync<InvalidOperationException>(
                async () => await agent.RunActionsAsync());
            
            Assert.Equal(goal, agent.CurrentGoal);
        }
Beispiel #2
0
        public async Task ShouldRunActionToReachGoal()
        {
            var goal = new TestGoal{Weight = 1};
            var planner = PlannerFactory.CreatePlanner();
            var agent = new FallbackAgent(planner, goal);
            
            agent.AddGoal(goal);
            agent.AddAction(new NoRunAction());

            await Assert.ThrowsAsync<NoRunException>(
                async () => await agent.RunActionsAsync());
        }