Example #1
0
        public async Task <ActionResult <bool> > DeleteApplicant(int id)
        {
            var applicant = await _service.GetAsync(id);

            if (applicant == null)
            {
                _logger?.LogDebug($"DELETE - Applicant with ID:\"{id}\" not found!");
                return(NotFound());
            }

            return(await _service.DeleteAsync(applicant));
        }
Example #2
0
        public async Task DeleteApplicant()
        {
            IApplicantDomainService service = GetService <IApplicantDomainService>();
            var applicant = new Applicant {
                Name = "Ali_1", FamilyName = "Hosseini", Address = "Address test", Age = 35, CountryOfOrigin = "Aruba", EMailAddress = "*****@*****.**"
            };
            await service.CreateAsync(applicant);

            //Check Existence
            var result = await service.GetAsync(applicant.ID);

            Assert.NotNull(result);

            //Delete
            var updateState = await service.DeleteAsync(applicant.ID);

            Assert.True(updateState);

            //Check
            var deletedResult = await service.GetAsync(applicant.ID);

            Assert.Null(deletedResult);
        }