Пример #1
0
        public void GetTest()
        {
            var user = new VrLifeServer.Database.DbModels.User();

            using (var db = new VrLifeDbContext())
            {
                user.Username   = "******";
                user.Passphrase = "password";
                db.Users.Add(user);
                db.SaveChanges();
            }
            User obj = User.Get(user.UserId);

            Assert.NotNull(obj);
            obj.Delete();
        }
Пример #2
0
        public void DeleteTest()
        {
            var user = new VrLifeServer.Database.DbModels.User();

            using (var db = new VrLifeDbContext())
            {
                user.Username   = "******";
                user.Passphrase = "password";
                db.Users.Add(user);
                db.SaveChanges();
            }
            ulong userId = user.UserId;
            User  obj    = new User(user);

            obj.Delete();
            using (var db = new VrLifeDbContext())
            {
                Assert.Null(db.Users.SingleOrDefault(x => x.UserId == userId));
            }
        }