Requiring test methods to be public? #2438
-
I recently found that it's permitted for test methods to be using Xunit;
public class TestClass
{
[Fact]
internal void TestMethod() { Assert.True(false); }
} I was surprised by this since most declarations that Xunit is aware of are supposed to be public, such as custom Fact attributes, fields containing theory data, etc. Was there a specific reason for this? Maybe compat? Is there any consideration toward changing this in the next major version? cc @jaredpar |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Classes must not be private for technical reasons, methods definitely do not. This is a long standing intentional feature and you can bet anything you want on that not changing Also be considerate we atting busy people in random discussions like this is something to avoid. Just because someone helped you once and you trust their input does not make that a considerate thing to do, just as you woudlnt randomly send them an email to ask a question you could ask on stackoverflow. |
Beta Was this translation helpful? Give feedback.
Classes must not be private for technical reasons, methods definitely do not. This is a long standing intentional feature and you can bet anything you want on that not changing
Also be considerate we atting busy people in random discussions like this is something to avoid. Just because someone helped you once and you trust their input does not make that a considerate thing to do, just as you woudlnt randomly send them an email to ask a question you could ask on stackoverflow.