public void DeckOfCards_ShouldCreateDeck() { IDeckOfCards sut = new DeckOfCards(); Assert.IsInstanceOf <IList <Card> >(sut.GetCards()); Assert.AreEqual(sut.GetCards().Count, 52); }
public void SortDescending_ShouldBeListDescending() { IDeckOfCards sut = new DeckOfCards(); sut.SortDescending(); Assert.AreEqual(sut.GetCards()[0].GetRank().GetValue(), 13); Assert.AreEqual(sut.GetCards()[sut.GetCards().Count - 1].GetRank().GetValue(), 1); }
public void Shuffle_ShouldBeDeckOf52() { IDeckOfCards sut = new DeckOfCards(); sut.Shuffle(); Assert.NotNull(sut.GetCards()); Assert.IsInstanceOf <List <Card> >(sut.GetCards()); Assert.AreEqual(sut.GetCards().Count, 52); }
public void RemoveRandomCardsAsync_ShouldBeCardsRemovedFromDeck() { IDeckOfCards sut = new DeckOfCards(); ValueTask <List <Card> > randomCardsTask = sut.RemoveRandomCardsAsync(5); List <Card> randomCards = randomCardsTask.Result; Assert.IsFalse(sut.GetCards().Contains(randomCards[0])); Assert.IsFalse(sut.GetCards().Contains(randomCards[1])); Assert.IsFalse(sut.GetCards().Contains(randomCards[2])); Assert.IsFalse(sut.GetCards().Contains(randomCards[3])); Assert.IsFalse(sut.GetCards().Contains(randomCards[4])); }
public void DeckOfCards_ShouldBeAceOfSpades() { List <Card> customDeck = new List <Card>(); CardName cardName = new CardName(ECardName.Ace); CardSuit cardSuit = new CardSuit(ECardSuit.Spades); Card aceOfSpades = new Card(cardName, cardSuit); customDeck.Add(aceOfSpades); IDeckOfCards sut = new DeckOfCards(customDeck); Assert.IsInstanceOf <IList <Card> >(sut.GetCards()); Assert.AreEqual(sut.GetCards().Count, 1); Assert.AreEqual(sut.GetCards()[0], aceOfSpades); }
public void AceUpTheSleeve_ShouldBeFiveAces() { DeckOfCards sut = new DeckOfCards(); sut.AceUpTheSleeve(); Assert.AreEqual(sut.GetCards().Count, 53); Assert.AreEqual(sut.GetAllCardsByCardName("Ace").Count, 5); }
public void AddCardsToDeckWithoutDuplicates_ShouldBe52Cards() { IDeckOfCards sut = new DeckOfCards(); IDeckOfCards deck2 = new DeckOfCards(); sut.AddCardsToDeckWithoutDuplicates(deck2.GetCards()); Assert.AreEqual(sut.GetCards().Count, 52); }
public void AddCardsToDeck_ShouldBe104Cards() { IDeckOfCards sut = new DeckOfCards(); IDeckOfCards deck2 = new DeckOfCards(); sut.AddCardsToDeck(deck2.GetCards()); Assert.AreEqual(sut.GetCards().Count, 104); }
public void AddCardToDeck_ShouldBe53Cards() { CardName cardName = new CardName(ECardName.Jack); CardSuit cardSuit = new CardSuit(ECardSuit.Diamonds); Card card = new Card(cardName, cardSuit); IDeckOfCards sut = new DeckOfCards(); sut.AddCardToDeck(card); Assert.AreEqual(sut.GetCards().Count, 53); }
public void ShowCards() { int cardCount = 0; foreach (int i in deck.GetCards()) { float co = cardOffset * cardCount; GameObject a; Vector3 temp = start = new Vector3(co, 0f); //a.transform.position = temp; } }
public JsonResult AddDeck() { IDeckOfCards deck; if (Session[SESSION_DECK] == null) { deck = new DeckOfCards(); } else { deck = (DeckOfCards)Session[SESSION_DECK]; IDeckOfCards deckToAdd = new DeckOfCards(); deck.AddCardsToDeck(deckToAdd.GetCards()); } Session[SESSION_DECK] = deck; // Update deck in session return(Json(deck, JsonRequestBehavior.AllowGet)); }
public void GetCards_ShouldBeListOfCards() { IDeckOfCards sut = new DeckOfCards(); Assert.IsInstanceOf <IList <Card> >(sut.GetCards()); }