Example #1
0
        public async void HowToHelpFunctionalityTest()
        {
            _token = await _accountManagementService.SignIn(TestingObjectProvider.Instance.Login);

            Assert.NotNull(_token);

            var info = TestingObjectProvider.Instance.HowToHelpInfo;

            Assert.NotNull(await _howToHelpInformationService.GetHelpInfo(HowToHelpInfoType.BecomeVolunteer, _token.Jwt));
            Assert.NotNull(await _howToHelpInformationService.GetHelpInfo(HowToHelpInfoType.Donate, _token.Jwt));
            Assert.True(await _howToHelpInformationService.UpdateOrCreateHelpInfo(info, HowToHelpInfoType.BecomeVolunteer, _token.Jwt));
            Assert.True(await _howToHelpInformationService.UpdateOrCreateHelpInfo(info, HowToHelpInfoType.Donate, _token.Jwt));
        }
Example #2
0
        public async Task <IActionResult> CreateEdit(HowToHelpViewModel howToHelpViewModel, CancellationToken cancellationToken)
        {
            if (howToHelpViewModel != null && ModelState.IsValid)
            {
                var updateVolunteerInfoResult = await _howToHelpInformationService.UpdateOrCreateHelpInfo(
                    howToHelpViewModel.BecomeVolunteerInfo, HowToHelpInfoType.BecomeVolunteer, CurrentCookiesToken, cancellationToken);

                var updateDonateInfoResult = await _howToHelpInformationService.UpdateOrCreateHelpInfo(
                    howToHelpViewModel.DonateInfo, HowToHelpInfoType.Donate, CurrentCookiesToken, cancellationToken);

                if (updateDonateInfoResult && updateVolunteerInfoResult)
                {
                    return(RedirectToAction("Info", new RouteValueDictionary(new { edit = false })));
                }

                CheckUnexpectedErrors();
            }

            ViewData["EditMode"] = true;
            return(View("Info", howToHelpViewModel));
        }
 public async void TestOfUpdatingBecomeVolunteerInfo()
 {
     Assert.True(await _howToHelpInformationService.UpdateOrCreateHelpInfo(_testingObject, HowToHelpInfoType.BecomeVolunteer, _token.Jwt));
 }