public void Setup() { mock = new Mock<IEventRepository>(); mock.Setup(m => m.Categories).Returns(new Category[] { new Category { CategoryId = 1, Name = "Hockey" }, new Category { CategoryId = 2, Name = "A category" }, new Category { CategoryId = 3, Name = "Other" } }.AsQueryable()); controller = new CategoryController(mock.Object); }