public void ManaParserTests_Success_4LeoninSquire_ReturnsCorrectTotalConvertedCostAndAverageConvertedCost()
        {
            var db = new CardsDB();
            var testCardName = "Leonin Squire";
            var testCardNameUndercase = testCardName.ToLower();

            var result = db.GetCardByName(testCardNameUndercase);
            var card = result.Result;
            var deck = new DeckModel(new[] { card, card, card, card });

            Assert.AreEqual(8, deck.TotalConvertedManaCost);
            Assert.AreEqual(2, deck.AverageConvertedManaCost);
        }
        public void ManaParserTests_Success_4LeoninSquire_ReturnsCorrectTotalActualCost()
        {
            var db = new CardsDB();
            var testCardName = "Leonin Squire";
            var testCardNameUndercase = testCardName.ToLower();

            var result = db.GetCardByName(testCardNameUndercase);
            var card = result.Result;
            var deck = new DeckModel(new[] { card, card, card, card });

            var totalCosts = deck.TotalCosts;

            //Makes the assumption that we just want the total number of each monocolor used, each hybrid color used, and each colorless used
            Assert.AreEqual(2, totalCosts.Count);
            Assert.AreEqual(4, totalCosts[ManaColors.Colorless]);
            Assert.AreEqual(4, totalCosts[ManaColors.White]);
        }
        public void ManaParserTests_Success_4LeoninSquire_ReturnsCorrectTotalGroupedCost()
        {
            var db = new CardsDB();
            var testCardName = "Leonin Squire";
            var testCardNameUndercase = testCardName.ToLower();
            var expectedCost = "1W";
            var convertedExpectedCost = new ManaCostModel(expectedCost);

            var result = db.GetCardByName(testCardNameUndercase);
            var card = result.Result;
            var deck = new DeckModel(new[] { card, card, card, card });

            var totalCosts = deck.TotalCostsByGroup;

            //Makes the assumption that we just want the total number of each monocolor used, each hybrid color used, and each colorless used
            Assert.AreEqual(1, totalCosts.Count);
            Assert.IsNotNull(totalCosts.Keys.FirstOrDefault());
            Assert.AreEqual(2, totalCosts.Keys.FirstOrDefault().Costs.Count);
            Assert.AreEqualCollections(convertedExpectedCost.Costs, totalCosts.Keys.FirstOrDefault().Costs);
            Assert.AreEqual(4, totalCosts.Values.FirstOrDefault());
        }
Ejemplo n.º 4
0
 protected DeckViewModel(DeckModel deckModel)
 {
     this.Model = deckModel;
       HookupCommands();
 }