예제 #1
0
        public async Task DetailsTest_ReturnsNotFound_WhenNoIdProvided()
        {
            KeukenhofWebsiteContext context = GetInMemoryDBMetData();
            var controller = new QenAController(context);
            var result     = await controller.Details(null);

            var viewResult = Assert.IsType <NotFoundResult>(result);
        }
예제 #2
0
        public async void QenA_Details()
        {
            KeukenhofWebsiteContext context = GetInMemoryDBMetData();
            var controller = new QenAController(context);
            var result     = await controller.Details(2) as ViewResult;

            var viewResult = Assert.IsType <ViewResult>(result);
            var qenb       = new QenA {
                AnswerId = 2, Question = "Welke kaas is blauw?", Answer = "Red"
            };

            Assert.Equal(qenb.ToString(), viewResult.ViewData.Model.ToString());
        }