IntelliTect's guidelines for coding and architecture. Documentation for IntelliTect's .NET Compiler Platform (Roslyn) Analyzers.
Fields should be specified in _PascalCase. Always with a leading underscore, regardless of visibility modifier.
Allowed
class SomeClass
{
public string _MyField;
}
Disallowed
class SomeClass
{
public string _myField;
public string myField;
}
Fields should be PascalCase
Allowed
class SomeClass
{
public string MyProperty { get; set; }
}
Disallowed
class SomeClass
{
public string myProperty { get; set; }
public string _MyProperty { get; set; }
}
Methods, including local functions, should be PascalCase
Note: Test methods decorated with test framework attributes from xUnit, NUnit, MSTest, or TUnit are exempt from this rule, as they commonly use underscores for readability (e.g., Method_Scenario_ExpectedResult). Any attribute from these framework namespaces will be recognized automatically.
Allowed
class SomeClass
{
public string GetEmpty() {
var output = LocalFunction();
string LocalFunction() {
return string.Empty();
}
return output;
}
}
Allowed (Test Methods)
[TestClass]
public class SomeClassTests
{
[TestMethod]
public void GetEmpty_WhenCalled_ReturnsEmptyString()
{
// Test implementation
}
}
Disallowed
class SomeClass
{
public string getEmpty() {
var output = localFunction();
string localFunction() {
return string.Empty();
}
return output;
}
}