public void AddCardTest005_AddToArena_ExeedesQty3() { CardInstance card = new CardInstance(new Card()); CardListEditorViewModel model = new CardListEditorViewModel(); model.CardsCollection = new System.Collections.ObjectModel.ObservableCollection <CardInstance>(); model.AddCard(card, 2); model.AddCard(card, 2); Assert.AreEqual(1, model.CardsCollection.Count); Assert.AreEqual(4, model.CardsCollection.First().Quantity); }
public void AddCardTest003_AddToCOnstructed_Qty3() { CardInstance card = new CardInstance(new Card()); CardListEditorViewModel model = new CardListEditorViewModel(); model.CardsCollection = new System.Collections.ObjectModel.ObservableCollection <CardInstance>(); model.LimitCardCount = true; model.AddCard(card, 2); model.AddCard(card, 1); Assert.AreEqual(1, model.CardsCollection.Count); Assert.AreEqual(3, model.CardsCollection.First().Quantity); }
public void AddCardTest004_AddToCOnstructed_ExeedesQty3() { int maxQty = 3; CardInstance card = new CardInstance(new Card()); CardInstance card2 = new CardInstance(new Card() { Id = card.CardId }); //in UI other instance of cardinstance is passed CardListEditorViewModel model = new CardListEditorViewModel(); model.LimitCardCount = true; model.CardsCollection = new System.Collections.ObjectModel.ObservableCollection <CardInstance>(); model.AddCard(card, 2); model.AddCard(card2, 2); Assert.AreEqual(1, model.CardsCollection.Count); Assert.AreEqual(maxQty, model.CardsCollection.First().Quantity); }