コード例 #1
0
        public void GetById()
        {
            int    i    = 1;
            string name = "dsa";
            var    c1   = new Card()
            {
                Name        = name,
                Description = "dsdasdas",
                Id          = i
            };
            var c2 = new Card()
            {
                Name        = "dsa",
                Description = "dsdasdas",
                Id          = 2
            };
            var c3 = new Card()
            {
                Name        = "dsa",
                Description = "dsdasdas",
                Id          = 3
            };

            Context.Cards.Add(c1);
            Context.Cards.Add(c2);
            Context.Cards.Add(c3);
            Context.SaveChanges();

            var result = CardRepository.GetCardById(i);

            Assert.IsNotNull(result);
            Assert.AreEqual(name, result.Name);
        }