Esempio n. 1
0
        public async Task MarkAsAnsweredShouldNotMarkNotExistingEmailId(int emailId)
        {
            var context = ApplicationDbContextInMemoryFactory.InitializeContext();
            var contactFormRepository = new EfRepository <ContactFormEntry>(context);
            var contactFormService    = new ContactFormService(contactFormRepository);

            await contactFormService.MarkAsAnsweredAsync(emailId);

            var result = await contactFormService.MarkAsAnsweredAsync(emailId);

            Assert.False(result);
        }
Esempio n. 2
0
        public async Task MarkAsAnsweredShouldMarkCorrectlyNotAnsweredEmailId()
        {
            var context = ApplicationDbContextInMemoryFactory.InitializeContext();
            var contactFormRepository = new EfRepository <ContactFormEntry>(context);
            var contactFormService    = new ContactFormService(contactFormRepository);

            var newEmailId = await this.GetNewEmailId(contactFormService, contactFormRepository);

            var result = await contactFormService.MarkAsAnsweredAsync(newEmailId);

            Assert.True(result);
        }