Ejemplo n.º 1
0
        public void CandFindCard()
        {
            var card = new Card { Name = "White Knight", CastingCost = "WW", Type = "Creature - Knight" };
            ICardRepository repository = new CardRepository();
            repository.Add(card);

            var fromDb = repository.FindCard("White");
            Assert.IsNotNull(fromDb);
            Assert.AreNotEqual(fromDb.Count, 0);
        }
Ejemplo n.º 2
0
        public void CanAddCard()
        {
            var card = new Card {Name = "White Knight", CastingCost = "WW", Type = "Creature - Knight"};

            ICardRepository repository = new CardRepository();
            repository.Add(card);

            // use session to try to load the product);
            using (var session = _sessionFactory.OpenSession())
            {
                var fromDb = session.Get<Card>(card.Id);

                // Test that the color was successfully inserted
                Assert.IsNotNull(fromDb);
                Assert.AreNotSame(card, fromDb);
                Assert.AreEqual(card.Name, fromDb.Name);
                Assert.AreEqual(card.CastingCost, fromDb.CastingCost);
                Assert.AreEqual(card.Type, fromDb.Type);
            }
        }