Esempio n. 1
0
 internal static OrmList ToOrmList(DalList list)
 {
     if (list != null)
         return new OrmList
         {
             Id = list.Id,
             Description = list.Description,
             OwnerId = list.OwnerId,
             Title = list.Title
         };
     return null;
 }
Esempio n. 2
0
        public void ListRepository_Add_IsNotNullWhenGet()
        {
            var dbData = new DalList
            {
                Id = 100,
                Description = "aaa",
                Title = "aaa"
            };
            var dbSetMock = new Mock<DbSet<OrmList>>();
            var dbContextMock = new Mock<EntityModelContext>();
            dbContextMock.Setup(x => x.Set<OrmList>()).Returns(dbSetMock.Object);

            var repo = new ListRepository(dbContextMock.Object);
            repo.Add(dbData);
            Assert.IsNotNull(repo.Get(100));
        }