title: How to tell which of TestCaseData are failing (in TestCaseSource code)
body: <p>I am using TFS with VS2013. I am using <code>TestCaseSource</code> when writing tests:</p>
  
  <pre><code>[Test]
  [TestCaseSource("GetExtraWifQuestionsTestData")]
  public void GetExtraWifQuestionsTest(WifWillTypeQuestionsViewModel viewModel, IEnumerable&lt;QuestionItemViewModel&gt; expected)
  {
      viewModel.GetExtraWifQuestions();
      for (int i = 0; i &lt; expected.Count(); i++)
      {
          Assert.True(expected.ElementAt(i).Equals(viewModel.QuestionItems.ElementAt(i)));
      }
  }
  </code></pre>
  
  <p>Problem is I have many test cases in <code>GetExtraWifQuestionsTestData()</code> and some of them are failing.
  Objects that are being constructed in testcase data are quite complex, and helpers are being used to generate part of data mocked. (Only few cases as examples there are many more)</p>
  
  <pre><code>public IEnumerable&lt;TestCaseData&gt; GetExtraWifQuestionsTestData()
      {
          yield return
              new TestCaseData(
                  new WifWillTypeQuestionsViewModel(
                      MocksHelper.WifView, 
                      new TransactionMain
                          {
                              TransactionDetailList =
                                  new Collection&lt;TransactionDetail&gt;(
                                  new[] { new TransactionDetail { DefaultQuestions = QuestionTestCaseDataHelper.WifWillTypeQuestions(), TransactionWill = new TransactionWill { IsCouple = 1L, WillTypeRecomendationResolutions = QuestionTestCaseDataHelper.WillTypeRecomendationResolutions.ToList()} } })
                          }, 
                      new QuestionControlFactory(MocksHelper.IViewFactory))
                      {
                          QuestionItems =
                              new CustomerQuestionCollection(
                              QuestionTestCaseDataHelper.WifWillTypeQuestionItemViewModelQuestionAnswerGeneratorByAnswerNullsNotAdded(true, true, null, false, false))
                      }, 
                  QuestionTestCaseDataHelper.WifWillTypeQuestionItemViewModelQuestionAnswerGeneratorByAnswerNullsNotAdded(true, true, null, false, false)
                      .Concat(QuestionTestCaseDataHelper.WifWillTypeQuestionItemViewModelQuestionAnswerGeneratorByAnswer(null, null, null, null, null, null, null).Where(o =&gt; o.Question.DisplayOrder == 7)));
          yield return
              new TestCaseData(
                  new WifWillTypeQuestionsViewModel(
                      MocksHelper.WifView, 
                      new TransactionMain
                          {
                              TransactionDetailList =
                                  new Collection&lt;TransactionDetail&gt;(
                                  new[] { new TransactionDetail { DefaultQuestions = QuestionTestCaseDataHelper.WifWillTypeQuestions(), TransactionWill = new TransactionWill { IsCouple = 1L, WillTypeRecomendationResolutions = QuestionTestCaseDataHelper.WillTypeRecomendationResolutions.ToList() } } })
                          }, 
                      new QuestionControlFactory(MocksHelper.IViewFactory))
                      {
                          QuestionItems =
                              new CustomerQuestionCollection(
                              QuestionTestCaseDataHelper.WifWillTypeQuestionItemViewModelQuestionAnswerGeneratorByAnswerNullsNotAdded(true, true, null, false, false, null, true))
                      },
                  QuestionTestCaseDataHelper.WifWillTypeQuestionItemViewModelQuestionAnswerGeneratorByAnswerNullsNotAdded(true, true, null, false, false, null, true)
                      .Concat(QuestionTestCaseDataHelper.WifWillTypeQuestionItemViewModelQuestionAnswerGeneratorByAnswer(null, null, null, null, null, null, null, null, null).Where(o =&gt; o.Question.DisplayOrder == 8)));
  }
  </code></pre>
  
  <p>I can run the specific test cases failing by using <code>Unit sessions window</code><br>
  <img src="https://i.stack.imgur.com/1xVo8.png" alt="enter image description here">
  Then by navigating stack trace I can figure out what caused the bug, and sometimes it is test case data that needs changing (mechanism works as expected - tests got out of date).</p>
  
  <p>But when I need to go and edit in <code>GetExtraWifQuestionsTestData</code> some <code>TestCaseData</code> I can't find a way to tell which one is failing exactly.
  <strong>How can I pinpoint which of test cases are failing?</strong> Is there any built in mechanism to do this, or some low effort 'hack'. Please when answering the question keep in mind we are talking NOT about this specific case, but how to do this in general when complicated mocking mechanisms are being used, and is not immediately obvious which one is which.</p>
  
  <p><strong>UPDATE:</strong> ATM I am commenting out all the cases and then uncommenting them one by one, however this is not a very efficient way.</p>