public void Index_WhenCalled_ReturnsCorrectViewBagAndModels() { // Arrange // Act ViewResult result = _controller.Index(string.Empty, string.Empty) as ViewResult; var model = (List <Experiment>)result.Model; // Assert Assert.AreEqual("Experiment", result.ViewBag.SelectedType); CollectionAssert.Contains(model, experiment1); CollectionAssert.Contains(model, experiment2); CollectionAssert.Contains(model, experiment3); }