-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
180 additions
and
176 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package gatewaywest | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/zond/godip" | ||
"github.com/zond/godip/orders" | ||
"github.com/zond/godip/state" | ||
|
||
tst "github.com/zond/godip/variants/testing" | ||
) | ||
|
||
func init() { | ||
godip.Debug = true | ||
} | ||
|
||
func startState(t *testing.T) *state.State { | ||
judge, err := GatewayWestStart() | ||
if err != nil { | ||
t.Fatalf("%v", err) | ||
} | ||
return judge | ||
} | ||
|
||
func TestGatewayWestBuildAnywhere(t *testing.T) { | ||
judge := startState(t) | ||
|
||
// Give Illini an extra SC. | ||
judge.SetSC("mar", Illini) | ||
|
||
// Spring movement | ||
judge.SetOrder("lin", orders.Move("lin", "aud")) | ||
judge.Next() | ||
// Spring retreat | ||
judge.Next() | ||
// Fall movement | ||
judge.SetOrder("aud", orders.Move("aud", "cal")) | ||
judge.Next() | ||
// Fall retreat | ||
judge.Next() | ||
|
||
// Fall adjustment - Try to build a new Army in Scotland. | ||
judge.SetOrder("mar", orders.BuildAnywhere("mar", godip.Army, time.Now())) | ||
judge.Next() | ||
// Check that it was successful. | ||
tst.AssertUnit(t, judge, "mar", godip.Unit{godip.Army, Illini}) | ||
} |
Oops, something went wrong.