コード例 #1
0
        public async Task SinglePunchTest()
        {
            this.model = new HumanoidModel();
            
            this.core.Initialize();

            foreach (var player in this.players)
            {

                model.Initialize(this.core, player);

                await this.UpdateAndWaitAsync(model, 10, 0);

                this.PressButtonAsync(this.core.KeyboardInput[player.InputIndex].Buttons[0], 1)
                    .FireAndForget();

                await this.UpdateAndWaitAsync(model, 1, 0);

                Assert.IsTrue(model.DesiredParameters.Punch);

                await this.UpdateAndWaitAsync(model, 1, 0);

                Assert.IsFalse(model.DesiredParameters.Punch);
                
            }
            
        }
コード例 #2
0
        public async Task RushPunchSuccessTest()
        {
            this.model = new HumanoidModel();

            this.core.Initialize();

            foreach (var player in this.players)
            {

                model.Initialize(this.core, player);
                this.ClearButton(this.core.KeyboardInput[player.InputIndex].Buttons[0]);

                await Task.Delay(400);

                await this.UpdateAndWaitAsync(model, 10, 0);
                

                this.UpdateAndWaitAsync(model, 100, 30).FireAndForget();

                this.RepeatButtonAsync(this.core.KeyboardInput[player.InputIndex].Buttons[0],
                        1, 100, 5)
                        .FireAndForget();

                await Task.Delay(100);

                //Assert.IsTrue(model.DesiredParameters.Punch);
                Assert.IsFalse(model.DesiredParameters.RushPunch);

                await Task.Delay(200);
                
                Assert.IsTrue(model.DesiredParameters.RushPunch);

                await Task.Delay(400);
                
                Assert.IsTrue(model.DesiredParameters.RushPunch);

                await Task.Delay(400);

                Assert.IsFalse(model.DesiredParameters.Punch);
                Assert.IsFalse(model.DesiredParameters.RushPunch);
            }
        }