public void CreatingNewUser() { var id = new UserId(Guid.NewGuid()); var email = "*****@*****.**"; var metroId = 11; var command = new CreateBasicUser { EmailAddress = email, GlobalPersonId = id.Gpid, MetroId = metroId }; new ConstructorScenarioFor <User>(() => User.CreateBasicUser(id, email, metroId)). Then(UserEvents.Created(email, id, metroId, false)). Assert(); }
public HttpResponseMessage PostCreateBarebonesUser(string email, int?metroid = null) { try { var resolvedMetroId = metroid.HasValue ? metroid.Value : 0; var command = new CreateBasicUser { EmailAddress = email, GlobalPersonId = Guid.NewGuid(), MetroId = resolvedMetroId }; _createUserCommandHandler.HandleCommand(command); return(Request.CreateResponse(HttpStatusCode.Created)); } catch (Exception ex) { var msg = string.Format("Error Occured on calling CreateBareboneUser(): {0}", ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError, msg)); } }