KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
See the below test fixture: using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; /// <summary> /// Tests relating to Harry Potter /// </summary> [TestFixture("Dumbledore")] public class HarryPotterTests { public string Name; public HarryPotterTests(string personName) { Name = personName; } [Test] public void Test() { Console.WriteLine(Name); } } What I'm trying to achieve is to see how parameterised test fixtures work. I haven't used them before so this is my first stab at it. It looks OK to me. Constructor with a string, and passing in a string in the actual test fixture attribute. It compiles. Test simply writes it out to a console window. The test however fails with this message: No suitable constructor was found Am I missing something blindly obvious? No matter where I put a breakpoint, nothing is hit, so it is failing very early on.
Tags (comma-separated)
Save Edits
Cancel