Is it possible to debug DynamicData attributes? (MSTest testing)

37 Views Asked by At

A bunch of data-driven MS Tests that have been working fine for many months get their parameters using the DynamicData attributes:

    [DynamicData(nameof(XRepository.XRepositoryData), typeof(XRepository),
        DynamicDataDisplayName = "mehtodAlertMessage", DynamicDataDisplayNameDeclaringType = typeof(DynamicDataAttributeExtension))]
    public void MehotdTest(string expected, string data)
    {
      (...)

 ////

 public class XRepository : ApplicationRepositoryBase
 {
    private static string[,] values;

        public static IEnumerable<object[]> XRepositoryData
        { 
            get
              {
                  GetCsvData(); //here is the attribute values initialized

                  yield return new object[]
                  {
                      Strings.InputFormatY,
                      ConvertColumnToString(CustomArray<string>.GetColumn(values, 0))
                  };
        
                  yield return new object[]
                  {
                      Strings.InputFormatZ,
                      ConvertColumnToString(CustomArray<string>.GetColumn(values, 1))
                  };
              }
          }

   (...)

string data is supposed to deliver some csv data information. When I run them locally on my machine, they work well, but when I execute them using Jenkins, the information contained data is partial and incomplete. I tried to use breaking points in XRepository.cs, but they were ignored. I cannot access GetCsvData() or ConvertColumnToString(). When I start debugging, I begin directly at MethodTest.

Can you access these two methods, GetCsvData() or ConvertColumnToString(), when executed? Can it be a timeout issue?

0

There are 0 best solutions below