public void ShouldReturnTheCorrectViewModel() { // Arrange var loggerService = new Mock <ILoggerService>().Object; var controller = new LoggerController(loggerService); // Act var result = controller.All(string.Empty) as ViewResult; // Assert result .Should() .NotBeNull(); var model = result.As <ViewResult>().Model; model .Should() .BeOfType <LoggerPagingViewModel>(); }