documentation:autoasserttesting
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
documentation:autoasserttesting [2013/06/06 08:27] – created mhgamework | documentation:autoasserttesting [2024/08/26 13:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
See PlayersTest.TestSimplePlayerInputController for an example: | See PlayersTest.TestSimplePlayerInputController for an example: | ||
// Autoassert example. | // Autoassert example. | ||
- | | + | |
- | var p = MockRepository.GenerateMock< | + | var p = MockRepository.GenerateMock< |
- | p.Position = Vector3.Zero; | + | p.Position = Vector3.Zero; |
- | + | ||
- | var c = new SimplePlayerInputController(p); | + | var c = new SimplePlayerInputController(p); |
- | c.MoveForward(); | + | c.MoveForward(); |
- | c.ProcessMovement(1); | + | c.ProcessMovement(1); |
- | + | ||
- | // autoAssert.Equal(p.Position) | + | // autoAssert.Equal(p.Position) |
- | + | ||
- | c.MoveForward(); | + | c.MoveForward(); |
- | c.MoveLeft(); | + | c.MoveLeft(); |
- | c.ProcessMovement(1); | + | c.ProcessMovement(1); |
- | // autoAssert.Equal(p.Position) | + | // autoAssert.Equal(p.Position) |
- | + | ||
- | c.MoveForward(); | + | c.MoveForward(); |
- | c.MoveLeft(); | + | c.MoveLeft(); |
- | c.MoveRight(); | + | c.MoveRight(); |
- | c.MoveBackward(); | + | c.MoveBackward(); |
- | c.Jump(); | + | c.Jump(); |
- | // autoAssert.Equal(p.Position) | + | // autoAssert.Equal(p.Position) |
documentation/autoasserttesting.1370507277.txt.gz · Last modified: 2024/08/26 13:57 (external edit)