The Data Doodle

A blog about visualizing, analyzing, and managing data

Test Classes Should Be Public

When creating tests in Visual Studio, the test class should be made public.

By default, when you add a new class in VS, it does NOT include the public decorator.

This works

Good
1
2
3
4
5
6
public class CameraControllerTests : BaseTest{
[Fact]
public void AuthAttributes(){
AssertIsAuthDecorated<VLogProfileController>();
}
}

This doesn’t work. It will never be run by test runner.

Bad
1
2
3
4
5
6
class CameraControllerTests : BaseTest{
[Fact]
public void AuthAttributes(){
AssertIsAuthDecorated<VLogProfileController>();
}
}