public async Task ReturnCorrectViewModel_WhenCalled() { // Arrange Mock <ISpellService> spellServiceMock = new Mock <ISpellService>(); Mock <IPDFService> pDFServiceMock = new Mock <IPDFService>(); IMemoryCache memoryCacheMock = new MemoryCache(new MemoryCacheOptions()); string validSortOrder = string.Empty; string validFilter = string.Empty; int validPageNumber = 1; int validPageSize = 10; IPagedList <Spell> spells = new PagedList <Spell>(new List <Spell>().AsQueryable(), validPageNumber, validPageSize); spellServiceMock.Setup(mock => mock.FilterSpellsAsync(validSortOrder, validFilter, validPageNumber, validPageSize)) .Returns(Task.FromResult(spells)); SpellController SUT = new SpellController( spellServiceMock.Object, pDFServiceMock.Object, memoryCacheMock); // Act var result = await SUT.Index() as ViewResult; // Assert Assert.IsInstanceOfType(result.Model, typeof(SpellIndexViewModel)); }