0

Why is my Test method called as often as many chars the _ConnectionString returns???

The con variable in the test method gets always passed the next char of the ConnectionString property like

con = d
con = a
con = t
con = a
con = s
...

which is the data source of the connection String etc...

private static string _ConnectionString;
        public static string ConnectionString
        {
            get
            {
                var conf = ConfigurationManager.ConnectionStrings["DefaultConnection"];
                _ConnectionString = conf.ConnectionString;
                return _ConnectionString;
            }
        }



        [Test]
        [Factory("ConnectionString")]
        public void TestMe(string con)
        {

        }
Pascal
  • 12,265
  • 25
  • 103
  • 195

1 Answers1

0

Because a string is an IEnumerable of Char :)

The Factory attribute looks for an IEnumerable data source with the name you specify. That clearly wasn't the outcome you were looking for, and could be considered a bug.

grahamrhay
  • 2,046
  • 4
  • 19
  • 29