Пример #1
0
 internal static OrmUserProfile ToOrmUserProfile(DalUserProfile profile)
 {
     if (profile != null)
         return new OrmUserProfile()
         {
             Email = profile.Email,
             Id = profile.Id,
             Name = profile.Name,
             Password = profile.Password,
             Photo = profile.Photo,
             TimeRegister = profile.TimeRegister
         };
     return null;
 }
Пример #2
0
        public void UserRepository_AddItem_IsNotNullWhenGet()
        {
            var dbData = new DalUserProfile
            {
                Id = 100,
                Email = "mail1",
                Name = "name1",
                Password = "******"
            };
            var dbSetMock = new Mock<DbSet<OrmUserProfile>>();
            var dbContextMock = new Mock<EntityModelContext>();
            dbContextMock.Setup(x => x.Set<OrmUserProfile>()).Returns(dbSetMock.Object);

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