コード例 #1
0
 public void CanCreateUser()
 {
     var preCount = userDbService.Count();
     var testUser = new User()
         {
             Email = "*****@*****.**",
             FullName = "Bob Smith",
             Username = "******"
         };
     userDbService.Create(testUser);
     Assert.AreEqual(userDbService.Count(),preCount + 1);
 }
コード例 #2
0
 public void CanGetUserById()
 {
     var testUser = new User()
         {
             Email = "*****@*****.**",
             FullName = "Frank Nodoby",
             Username = "******"
         };
     userDbService.Create(testUser);
     var id = testUser.GetIdAsString();
     var retrievedUser = userDbService.GetById(id);
     Assert.AreEqual(retrievedUser.Email,testUser.Email);
     Assert.AreEqual(retrievedUser.FullName, testUser.FullName);
     Assert.AreEqual(retrievedUser.Username, testUser.Username);
 }
コード例 #3
0
        public void CanCreateUser()
        {
            var user = new User
            {
                AuthenticationType = "basic",
                Email = "*****@*****.**",
                FullName = "Me You",
                Id = new ObjectId(Guid.NewGuid().ToString()),
                SecurityKey = "MyPassword",
                TeamIds = new List<ObjectId>(),
                Username = "******"
            };

            _userDbService.Create(user);
        }