Esempio n. 1
0
        public virtual async Task <IActionResult> ContactUs()
        {
            var model = new ContactUsModel();

            model = await _commonModelFactory.PrepareContactUsModelAsync(model, false);

            return(View(model));
        }
Esempio n. 2
0
        public async Task CanPrepareContactUsModel()
        {
            var model = new ContactUsModel();

            model = await _commonModelFactory.PrepareContactUsModelAsync(model, true);

            model.SubjectEnabled = _commonSettings.SubjectFieldOnContactUsForm;
            model.DisplayCaptcha.Should().BeFalse();
            model.Email.Should().BeNullOrEmpty();
            model.FullName.Should().BeNullOrEmpty();

            model = await _commonModelFactory.PrepareContactUsModelAsync(model, false);

            model.SubjectEnabled = _commonSettings.SubjectFieldOnContactUsForm;
            model.DisplayCaptcha.Should().BeFalse();
            model.Email.Should().Be(NopTestsDefaults.AdminEmail);
            model.FullName.Should().Be("John Smith");
        }