public void TestIndexView() { _connectionController.Index(); PartialViewResult actionResult = _connectionController.GetConnectionList() as PartialViewResult; Assert.IsNotNull(actionResult, "Connection list is null"); ConnectionStatusViewModel connectionStatusViewModel = actionResult.Model as ConnectionStatusViewModel; Assert.IsNotNull(connectionStatusViewModel, "Incorrect model view"); int countOfStatuses = _connectionCheckerService.ConnectionStatusStates.Count; Assert.AreEqual( countOfStatuses, connectionStatusViewModel.ConnectionStatuses.Count, "Connection list don't show all connections"); }