public void ForTestFile_WhenFileNameIsValid_ShouldNotReport(string correctFileName) { var workspace = new UnitTestWorkspace { FileNames = new[] { correctFileName }, SourceFiles = new[] { "" }, Analyzer = new TestNamingAnalyzer() }; Verify(workspace); }
public void ForTestProject_WhenProjectNameIsValid_ShouldNotReport(string correctProjectName) { var workspace = new UnitTestWorkspace { ProjectName = correctProjectName, SourceFiles = new[] { "" }, Analyzer = new TestNamingAnalyzer() }; Verify(workspace); }
public void ForTestFile_WhenFileNameIsInvalid_ShouldReport(string incorrectFileName) { var workspace = new UnitTestWorkspace { FileNames = new [] { incorrectFileName }, SourceFiles = new[] { "[NUnit.Framework.TestFixture] public class Tests {}" }, Analyzer = new TestNamingAnalyzer() }; Verify(workspace, new DiagnosticResult { Id = Descriptors.Itsa1000_TestFileNaming.Id, Message = $"Test file '{incorrectFileName}' containing tests has an invalid name.", Severity = DiagnosticSeverity.Error }); }
public void ForTestProject_WhenProjectNameIsInvalid_ShouldReport(string incorrectProjectName) { var workspace = new UnitTestWorkspace { ProjectName = incorrectProjectName, SourceFiles = new [] { "" }, Analyzer = new TestNamingAnalyzer() }; Verify(workspace, new DiagnosticResult { Id = Descriptors.Itsa1003_TestProjectNaming.Id, Locations = new[] { new DiagnosticResultLocation() }, Message = $"Test project '{incorrectProjectName}' has an invalid ending.", Severity = DiagnosticSeverity.Error }); }