コード例 #1
0
ファイル: AdoTests.cs プロジェクト: ColeJSmith19/guildWork
        public void CanDeleteCardInfo()
        {
            CardInfo cardInfoToAdd = new CardInfo();
            var      repo          = new CardInfoRepositoryADO();

            cardInfoToAdd.CardId     = 7;
            cardInfoToAdd.CardName   = "Ponder";
            cardInfoToAdd.CmcId      = 1;
            cardInfoToAdd.CardArtURL = "ponder.jpg";
            cardInfoToAdd.CardText   = "Look at the top 3 cards.";
            cardInfoToAdd.Power      = 1;
            cardInfoToAdd.Toughness  = 1;
            cardInfoToAdd.ArtistId   = 1;
            cardInfoToAdd.CardNumber = "37";
            cardInfoToAdd.MSRP       = 20;
            cardInfoToAdd.SalePrice  = 15;

            repo.Insert(cardInfoToAdd);

            var loaded = repo.GetById(7);

            Assert.IsNotNull(loaded);

            repo.Delete(7);
            loaded = repo.GetById(7);

            Assert.IsNull(loaded);
        }
コード例 #2
0
ファイル: AdoTests.cs プロジェクト: ColeJSmith19/guildWork
        public void CanUpdateCardInfo()
        {
            CardInfo cardInfoToAdd = new CardInfo();
            var      repo          = new CardInfoRepositoryADO();

            cardInfoToAdd.CardId     = 7;
            cardInfoToAdd.CardName   = "Ponder";
            cardInfoToAdd.CmcId      = 1;
            cardInfoToAdd.CardArtURL = "ponder.jpg";
            cardInfoToAdd.CardText   = "Look at the top 3 cards.";
            cardInfoToAdd.Power      = 1;
            cardInfoToAdd.Toughness  = 1;
            cardInfoToAdd.ArtistId   = 1;
            cardInfoToAdd.CardNumber = "37";
            cardInfoToAdd.MSRP       = 20;
            cardInfoToAdd.SalePrice  = 15;

            repo.Insert(cardInfoToAdd);

            cardInfoToAdd.CardId     = 8;
            cardInfoToAdd.CardName   = "Brainstorm";
            cardInfoToAdd.CmcId      = 1;
            cardInfoToAdd.CardArtURL = "Brainstorm.jpg";
            cardInfoToAdd.CardText   = "Draw 3.";
            cardInfoToAdd.Power      = null;
            cardInfoToAdd.Toughness  = null;
            cardInfoToAdd.ArtistId   = 1;
            cardInfoToAdd.CardNumber = "30";
            cardInfoToAdd.MSRP       = 25;
            cardInfoToAdd.SalePrice  = 10;

            repo.Update(cardInfoToAdd);

            var updatedCardInfo = repo.GetById(8);

            Assert.AreEqual(8, cardInfoToAdd.CardId);
            Assert.AreEqual("Brainstorm", cardInfoToAdd.CardName);
            Assert.AreEqual(1, cardInfoToAdd.CmcId);
            Assert.AreEqual("Brainstorm.jpg", cardInfoToAdd.CardArtURL);
            Assert.AreEqual("Draw 3.", cardInfoToAdd.CardText);
            Assert.AreEqual(null, cardInfoToAdd.Power);
            Assert.AreEqual(null, cardInfoToAdd.Toughness);
            Assert.AreEqual(1, cardInfoToAdd.ArtistId);
            Assert.AreEqual("30", cardInfoToAdd.CardNumber);
            Assert.AreEqual(25, cardInfoToAdd.MSRP);
            Assert.AreEqual(10, cardInfoToAdd.SalePrice);
        }
コード例 #3
0
ファイル: AdoTests.cs プロジェクト: ColeJSmith19/guildWork
        public void CanAddCardInfo()
        {
            CardInfo cardInfoToAdd = new CardInfo();
            var      repo          = new CardInfoRepositoryADO();

            cardInfoToAdd.CardId     = 7;
            cardInfoToAdd.CardName   = "Ponder";
            cardInfoToAdd.CmcId      = 1;
            cardInfoToAdd.CardArtURL = "ponder.jpg";
            cardInfoToAdd.CardText   = "Look at the top 3 cards.";
            cardInfoToAdd.SetName    = "Kamigawa";
            cardInfoToAdd.SetId      = "KMG";
            cardInfoToAdd.Power      = null;
            cardInfoToAdd.Toughness  = null;
            cardInfoToAdd.ArtistId   = 1;
            cardInfoToAdd.CardNumber = "37";
            cardInfoToAdd.MSRP       = 20;
            cardInfoToAdd.SalePrice  = 15;

            repo.Insert(cardInfoToAdd);

            Assert.AreEqual(7, cardInfoToAdd.CardId);
        }