public void Dogma_Action_OnlyActivePlayerQualifies_RequiredAction() { IPlayer player1 = GeneratePlayer(1, new Dictionary <Symbol, int>() { { Symbol.Clock, 0 }, { Symbol.Crown, 0 }, { Symbol.Factory, 0 }, { Symbol.Leaf, 0 }, { Symbol.Lightbulb, 0 }, { Symbol.Tower, 1 }, { Symbol.Blank, 0 }, }); IPlayer player2 = GeneratePlayer(1, new Dictionary <Symbol, int>() { { Symbol.Clock, 0 }, { Symbol.Crown, 0 }, { Symbol.Factory, 0 }, { Symbol.Leaf, 0 }, { Symbol.Lightbulb, 0 }, { Symbol.Tower, 0 }, { Symbol.Blank, 0 }, }); IPlayer player3 = GeneratePlayer(1, new Dictionary <Symbol, int>() { { Symbol.Clock, 0 }, { Symbol.Crown, 0 }, { Symbol.Factory, 0 }, { Symbol.Leaf, 0 }, { Symbol.Lightbulb, 0 }, { Symbol.Tower, 0 }, { Symbol.Blank, 0 }, }); IPlayer player4 = GeneratePlayer(1, new Dictionary <Symbol, int>() { { Symbol.Clock, 0 }, { Symbol.Crown, 0 }, { Symbol.Factory, 0 }, { Symbol.Leaf, 0 }, { Symbol.Lightbulb, 0 }, { Symbol.Tower, 0 }, { Symbol.Blank, 0 }, }); playerActionsTaken = new Dictionary <IPlayer, int> { { player1, 0 }, { player2, 0 }, { player3, 0 }, { player4, 0 }, }; playerActionsCalled = new Dictionary <IPlayer, int> { { player1, 0 }, { player2, 0 }, { player3, 0 }, { player4, 0 }, }; testGame = new Game { Players = new List <IPlayer> { player1, player2, player3, player4, }, AgeDecks = new List <Deck> { new Deck { Age = 1, Cards = new List <ICard> { new Card() } } } }; var testCard = MockRepository.GenerateStub <ICard>(); testCard.Stub(c => c.Actions).Return(new List <CardAction> { new CardAction(ActionType.Required, Symbol.Tower, "test", TestRequiredActionHandler) }); Dogma.Action(testCard, player1, testGame); Assert.AreEqual(1, playerActionsCalled[player1]); Assert.AreEqual(0, playerActionsCalled[player2]); Assert.AreEqual(0, playerActionsCalled[player3]); Assert.AreEqual(0, playerActionsCalled[player4]); Assert.AreEqual(1, playerActionsTaken[player1]); Assert.AreEqual(0, playerActionsTaken[player2]); Assert.AreEqual(0, playerActionsTaken[player3]); Assert.AreEqual(0, playerActionsTaken[player4]); Assert.AreEqual(0, player1.Hand.Count()); //test free draw action Assert.AreEqual(player1, targetedPlayer); //test to make sure the current player went last Assert.AreEqual(player1, activePlayer); }
/// <summary>Construct Public ESI interface</summary> public Public() : base() { Alliance = new AllianceMain(this); Character = new CharacterMain(this); Corporation = new CorporationMain(this); Dogma = new Dogma(this); FactionWarfare = new FactionWarfare(this); Incursions = new Incursions(this); Industry = new Industry(this); Insurance = new Insurance(this); Killmails = new Killmails(this); Loyalty = new Loyalty(this); Market = new Market(this); Opportunities = new Opportunities(this); PlanetaryInteraction = new PlanetaryInteraction(this); Routes = new Routes(this); Search = new Search(this); Sovereignty = new Sovereignty(this); Status = new Status(this); Universe = new Universe(this); Wars = new Wars(this); }
// ReSharper disable once InconsistentNaming private void initializeAPI() { Alliance = new Alliance(dataSource) { HTTP = http }; Assets = new Assets(dataSource) { HTTP = http }; Bookmarks = new Bookmarks(dataSource) { HTTP = http }; Calendar = new Calendar(dataSource) { HTTP = http }; Character = new Character(dataSource) { HTTP = http }; Clones = new Clones(dataSource) { HTTP = http }; Contacts = new Contacts(dataSource) { HTTP = http }; Contracts = new Contracts(dataSource) { HTTP = http }; Corporation = new Corporation(dataSource) { HTTP = http }; Dogma = new Dogma(dataSource) { HTTP = http }; FactionWarfare = new FactionWarfare(dataSource) { HTTP = http }; Fittings = new Fittings(dataSource) { HTTP = http }; Fleets = new Fleets(dataSource) { HTTP = http }; Incursion = new Incursions(dataSource) { HTTP = http }; Industry = new Industry(dataSource) { HTTP = http }; Insurance = new Insurance(dataSource) { HTTP = http }; Killmails = new Killmails(dataSource) { HTTP = http }; Location = new Location(dataSource) { HTTP = http }; Loyalty = new Loyalty(dataSource) { HTTP = http }; Mail = new Mail(dataSource) { HTTP = http }; Market = new Market(dataSource) { HTTP = http }; Opportunities = new Opportunities(dataSource) { HTTP = http }; PlanetaryInteraction = new PlanetaryInteraction(dataSource) { HTTP = http }; Routes = new Routes(dataSource) { HTTP = http }; Search = new Search(dataSource) { HTTP = http }; Skills = new Skills(dataSource) { HTTP = http }; Sovereignty = new Sovereignty(dataSource) { HTTP = http }; Status = new Status(dataSource) { HTTP = http }; Universe = new Universe(dataSource) { HTTP = http }; UserInterface = new UserInterface(dataSource) { HTTP = http }; Wallet = new Wallet(dataSource) { HTTP = http }; Wars = new Wars(dataSource) { HTTP = http }; }