public async Task Will_Return_True_When_Template_Found()
        {
            var templateId = _templates[0].TemplateId;
            var ct         = CancellationToken.None;

            _tenantIdProvider.Setup(x => x.TenantId).Returns(Tenant1Id).Verifiable();

            var result = await _repository.TemplateExists(templateId, ct);

            result.Should().BeTrue();
        }
Exemplo n.º 2
0
        public ActionResult Create(int?jobListingId)
        {
            if (jobListingId == null)
            {
                return(NotFound());
            }
            if (!_jobListingsRepository.JobListingExists(jobListingId))
            {
                return(NotFound());
            }

            if (_templatesRepository.TemplateExists(jobListingId))
            {
                TempData["templateExists"] = "Template already exists!";
                ViewBag.SelectedNav        = "Dashboard";
                return(RedirectToAction("Index", "JobListings"));
            }
            ViewBag.SelectedNav = "Dashboard";
            return(View());
        }