public HttpResponseMessage Delete(UserModel user) { if (_deleteUserCommand.Execute(user)) { return new HttpResponseMessage(HttpStatusCode.OK); } return new HttpResponseMessage(HttpStatusCode.NotImplemented); }
public bool Execute(UserModel user) { var result = _repo.AddUser(user); //could log if user not added ??? return result; }
public HttpResponseMessage Add(UserModel user) { if (_addUserCommand.Execute(user)) { return new HttpResponseMessage(HttpStatusCode.Created); } return new HttpResponseMessage(HttpStatusCode.NotImplemented); }
public UserModel ToUserModel() { var m = localUserModel ?? ( localUserModel = new UserModel() ); m.Gateway = Gateway; m.Hash = Hash; m.Password = Password; m.UserName = UserName; return m; }
public void should_ReturnNotImplementedStatus_When_AUserIsNotUpdated() { var user = new UserModel { FirstName = "FirstName" }; var expectedStatusCode = new HttpResponseMessage(HttpStatusCode.NotImplemented); _mockedEditUserCommand.Stub(c => c.Execute(user)).Return(false); var result = _controller.Edit(user); Assert.That(result.StatusCode, Is.EqualTo(expectedStatusCode.StatusCode)); }
public void should_CallIntoProvider_When_DeleteUserIsCalled() { var user = new UserModel { FirstName = "FirstName" }; _mockMongoProvider.Stub(p => p.Delete(user)).Return(true); var result = _repo.DeleteUser(user); _mockMongoProvider.AssertWasCalled(p => p.Delete(Arg<UserModel>.Is.Equal(user))); Assert.That(result, Is.True); }
public static User ConvertToDB(UserModel user) { var newUser = new User { First_name = user.First_name, Last_name = user.Last_name, Email = user.Email, Passwrd = user.Passwrd }; return newUser; }
public void should_ReturnCreatedStatus_When_AUserIsAddedSuccessfully() { var user = new UserModel {FirstName = "FirstName"}; var expectedStatusCode = new HttpResponseMessage(HttpStatusCode.Created); _mockedAddUserCommand.Stub(c => c.Execute(user)).Return(true); var result = _controller.Add(user); Assert.That(result.StatusCode, Is.EqualTo(expectedStatusCode.StatusCode)); }
public void Update(UserModel user) { if(user.UserId == 0) { CreatedDate = DateTime.Now; } Username = user.Username; Password = user.Password; EmailAddress = user.EmailAddress; PhoneNumber = user.PhoneNumber; TwitterHandle = user.TwitterHandle; }
private void populateGameSource(UserModel user, GameSourceResponseModel gameSource) { var endTime = new DateTime(); var timeTracker = PageHandler.TimeTracker; var time = endTime - timeTracker.StartTime; timeTracker.NumOfTimes++; timeTracker.TimeValue += time; // PageHandler.DebugUI.lblHowFast.Text = ( "Time Taken: " + ( timeTracker.TimeValue / timeTracker.NumOfTimes ) ); PageHandler.CodeEditorUI.codeEditor.Information.editor.SetValue(gameSource.Content); /* buildSite.CodeEditorUI.codeEditor.Information.editor.SetMarker(0, "<span style=\"color: #900\"> </span> %N%");*/ PageHandler.CodeEditorUI.codeEditor.Information.editor.Refresh(); }
public bool AddNewUser(UserModel user) { bool result = false; try { result = userContext.Add(UserConverter.ConvertToDB(user)); } catch (Exception e) { Logger.Log.Error(e); } return result; }
private void OnUserCreateFn(UserModel user, UserCreateResponse o) { if (o.Successful) { myUIManager.ClientInfo.LoggedInUser = user; myCreateUIService.CreateSingleton(HomeController.View); myScope.SwingAway(SwingDirection.Left, false, null); } else { myMessageService.PopupOkay("Bad!", "You no create! It exist! What up!!?", () => { }); } }
public ActionResult SignUp(UserModel newUser) { if (ModelState.IsValid) { if (userService.IsEmailUnique(newUser.Email)) { userService.AddNewUser(newUser); Logger.Log.Debug("new user " + newUser.Email + " has registered"); return RedirectToAction("RegisterSuccess", "Account"); } ViewBag.errorMessage = "Email is already in use!"; } return View(); }
private void OnLoginFn(UserModel user, UserLoginResponse data) { if (data.Successful) { myUIManager.ClientInfo.LoggedInUser = user; myCreateUIService.CreateSingleton(HomeController.View); myScope.SwingAway(SwingDirection.Left, false, null); } else { myMessageService.PopupOkay("Bad!", "You no login!", () => { }); } }
public async Task<IHttpActionResult> Register(UserModel userModel) { if (!ModelState.IsValid) { return BadRequest(ModelState); } IdentityResult result = await new Authentication { }.RegisterUser(userModel); IHttpActionResult errorResult = GetErrorResult(result); if (errorResult != null) { return errorResult; } return Ok(); }
public async Task<IHttpActionResult> Register(UserModel userModel) { if (!ModelState.IsValid) { return BadRequest(ModelState); } var result = await authRepository.RegisterUser(userModel); var errorResult = GetErrorResult(result); if (errorResult != null) { return errorResult; } return Ok(); }
public bool DeleteUser(UserModel user) { return _repository.Delete(user); }
public UserLoginValidator(UserModel user) { User = user; }
private void GetRoomInfo(UserModel user, GetRoomInfoResponse o) { PopulateGameRoom(o.Room); }
private void GetChatLines(UserModel user, ChatMessagesModel o) { myChatBox.AddChatMessages(o.Messages); }
private void GetChatInfo(UserModel user, ChatRoomInfoModel o) { PopulateChatRoom(o.Info); }
private void OnDeveloperCreateGameReceivedFn(UserModel user, DeveloperCreateGameResponse o) { }
private void OnDeveloperUpdateGameReceivedFn(UserModel user, DeveloperUpdateGameResponse o) { myScope.Model.UpdateStatus = UpdateStatusType.Synced; myScope.Apply(); }
private void GetChatLines(UserModel user, ChatMessagesModel o) { myScope.Model.ChatLines.AddRange(o.Messages); myScope.Apply(); }
private void OnOnGetGamesByUserReceivedFn(UserModel user, GetGamesByUserResponse response) { myScope.Model.Games = response.Games; myScope.Apply(); }
private void OnDoesGameNameExistReceivedFn(UserModel user, DoesGameExistResponse o) { }
public bool AddUser(UserModel user) { return _repository.Insert(user); }
public void should_CallIntoUserRepositry_When_Invoked() { var user = new UserModel { FirstName = "FirstName" }; _command.Execute(user); _mockedRepo.AssertWasCalled(r => r.UpdateUser(Arg<UserModel>.Is.Equal(user))); }
void clientDebugManagerService_OnGetDebugLog(UserModel user, DebugGameLogModel o) { scope.Model.Log.Add(o.Value); scope.Apply(); }
public bool UpdateUser(UserModel user) { return _repository.Update(user); }