public override void PerformTest() { DirectoryString res = new DirectoryString("test"); Restriction restriction = new Restriction(res.GetString()); checkConstruction(restriction, res); try { Restriction.GetInstance(new Object()); Fail("GetInstance() failed to detect bad object."); } catch (ArgumentException) { // expected } }