public void CreateApiUserTest()
        {
            IHandleJobs repo = new JobRepository("test");
            var         sut  = repo.CreateApiUser("test", "test");

            sut.Result.Success.Should().BeTrue();
        }
        public async Task <IHttpActionResult> NewApiUser(string username, string passwort, bool asAdmin = false)
        {
            IHandleJobs repo   = new JobRepository(_username);
            var         result = await repo.CreateApiUser(username, passwort, asAdmin);

            if (!result.Success)
            {
                return(Content(HttpStatusCode.BadRequest, result.Message));
            }

            var apiResult = new JobResult <SemasResult>()
            {
                SemasResult = new SemasResult <SemasResult>(result.Success, result.Message),
                _links      = new Link()
                {
                    _actions = new List <Action>()
                    {
                        CreateActionLink <AdminController>(Names.DeleteApiUser, c => c.DeleteApiUser(username), Names.DeleteApiUser),
                        !asAdmin?CreateActionLink <AdminController>(Names.SetApiUserAsAdmin, c => c.SetApiUserAsAdmin(username), Names.SetApiUserAsAdmin) : null,
                            asAdmin? CreateActionLink <AdminController>(Names.RevokeAdminFromApiUser, c => c.RevokeAdminFromApiUser(username), Names.RevokeAdminFromApiUser):null,
                    }
                }
            };

            apiResult._links._actions.RemoveAll(c => c == null);
            return(Ok(apiResult));
        }