Exemplo n.º 1
0
        public async void HeleprsFunctinalityTest()
        {
            _token = await _accountManagementService.SignIn(TestingObjectProvider.Instance.Login);

            Assert.NotNull(_token);

            var helper = TestingObjectProvider.Instance.Helper;

            Assert.NotNull(_helpersManagementService.GetAllHelpers(_token.Jwt).Result);
            Assert.True(_helpersManagementService.CreateHelper(helper, _token.Jwt).Result);
            Assert.True(_helpersManagementService.DeleteHelper(helper.Id, _token.Jwt).Result);
            Assert.NotNull(_helpersManagementService.GetHelper(helper.Id, _token.Jwt).Result);
            Assert.True(_helpersManagementService.UpdateHelper(helper, _token.Jwt).Result);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Add(
            [Bind("Category, Name, Surname, PhoneNumber, Email, Address, Notes")]
            Helper helper, CancellationToken cancellationToken)
        {
            if (helper != null && ModelState.IsValid)
            {
                if (await _helpersManagementService.CreateHelper(helper, AuthService.ReadCookie(HttpContext, AppSettings.CookieTokenName, true), cancellationToken))
                {
                    return(Json(new { success = true }));
                }

                CheckUnexpectedErrors();
            }

            return(PartialView(helper));
        }
        public void TestOfCreatingNewHelper()
        {
            var result = _helpersManagementService.CreateHelper(_testingHelper, _token.Jwt).Result;

            Assert.True(result);
        }