27 lines
991 B
C#
27 lines
991 B
C#
using SideScrollerGame.Sim.Input;
|
|
using SideScrollerGame.Sim.Verification;
|
|
|
|
namespace SideScrollerGame.Sim.Tests;
|
|
|
|
public sealed class SimulationVerificationTests
|
|
{
|
|
[Fact]
|
|
public void RoundTripStateMode_AllowsStepping()
|
|
{
|
|
Simulation simulation = new(SimulationTestFactory.CreateGameDefinition(), SimulationTestFactory.CreateConfig(VerificationMode.RoundTripState), 22);
|
|
|
|
var result = simulation.Step(SimulationTestFactory.CreateTick(1, new MoveAxisChanged(new(1), 1, 0)));
|
|
|
|
Assert.Equal(1, result.CurrentSnapshot.Tick);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoundTripAndStepCloneMode_AllowsStepping()
|
|
{
|
|
Simulation simulation = new(SimulationTestFactory.CreateGameDefinition(), SimulationTestFactory.CreateConfig(VerificationMode.RoundTripAndStepClone), 23);
|
|
|
|
var result = simulation.Step(SimulationTestFactory.CreateTick(1, new ButtonChanged(new(1), InputButton.Jump, true)));
|
|
|
|
Assert.Equal(1, result.CurrentSnapshot.Tick);
|
|
}
|
|
} |