Exemplo n.º 1
0
        public void Find_FindMagicCardDatabase_MagicCard()
        {
            //Arrange
            MagicCard testMagicCard = new MagicCard("1", "2", "2", "2", "2", 1);

            testMagicCard.Save();

            //Act
            MagicCard foundMagicCard = MagicCard.Find(testMagicCard.GetId());

            //Assert
            Assert.AreEqual(testMagicCard, foundMagicCard);
        }
Exemplo n.º 2
0
        public void Save_DatabaseAssignsIdToObject_Id()
        {
            //Arrange
            MagicCard testMagicCard  = new MagicCard("1", "1", "1", "1", "1", 1);
            MagicCard testMagicCard2 = new MagicCard("1", "1", "1", "1", "1", 1);

            //Act
            testMagicCard.Save();
            MagicCard savedCard = MagicCard.GetAll()[0];

            int result = savedCard.GetId();
            int testId = testMagicCard.GetId();

            //Assert
            Assert.AreEqual(testId, result);
        }