public void Should_Throw_If_RuleUrl_Is_Different(string expectedValue, string actualValue) { // Given var fixture = new IssueCheckerFixture(); var issue = fixture.IssueBuilder .OfRule(fixture.Rule, new Uri(actualValue)) .Create(); // When var result = Record.Exception(() => IssueChecker.Check( issue, fixture.ProviderType, fixture.ProviderName, fixture.ProjectFileRelativePath, fixture.ProjectName, fixture.AffectedFileRelativePath, fixture.Line, fixture.Message, fixture.Priority, fixture.PriorityName, fixture.Rule, new Uri(expectedValue))); // Then result.ShouldBeOfType <Exception>(); result.Message.ShouldStartWith("Expected issue.RuleUrl"); }
public void Should_Throw_If_Issue_Is_Null() { // Given var fixture = new IssueCheckerFixture(); IIssue issue = null; // When var result = Record.Exception(() => IssueChecker.Check( issue, fixture.ProviderType, fixture.ProviderName, fixture.ProjectFileRelativePath, fixture.ProjectName, fixture.AffectedFileRelativePath, fixture.Line, fixture.Message, fixture.Priority, fixture.PriorityName, fixture.Rule, fixture.RuleUrl)); // Then result.IsArgumentNullException("issue"); }
public void Should_Throw_If_ProviderName_Is_Different(string expectedValue, string actualValue) { // Given var fixture = new IssueCheckerFixture("Message", "ProviderType", actualValue); // When var result = Record.Exception(() => IssueChecker.Check( fixture.Issue, fixture.ProviderType, expectedValue, fixture.ProjectFileRelativePath, fixture.ProjectName, fixture.AffectedFileRelativePath, fixture.Line, fixture.Message, fixture.Priority, fixture.PriorityName, fixture.Rule, fixture.RuleUrl)); // Then result.ShouldBeOfType <Exception>(); result.Message.ShouldStartWith("Expected issue.ProviderName"); }
public void Should_Throw_If_MessageText_Is_Different(string expectedValue, string actualValue) { // Given var fixture = new IssueCheckerFixture("Identifier", actualValue, "ProviderType", "ProviderName"); // When var result = Record.Exception(() => IssueChecker.Check( fixture.Issue, fixture.ProviderType, fixture.ProviderName, fixture.Run, fixture.Identifier, fixture.ProjectFileRelativePath, fixture.ProjectName, fixture.AffectedFileRelativePath, fixture.Line, fixture.EndLine, fixture.Column, fixture.EndColumn, fixture.FileLink, expectedValue, fixture.MessageHtml, fixture.MessageMarkdown, fixture.Priority, fixture.PriorityName, fixture.Rule, fixture.RuleUrl)); // Then result.ShouldBeOfType <Exception>(); result.Message.ShouldStartWith("Expected issue.MessageText"); }
public void Should_Not_Throw_If_All_Values_Are_The_Same() { // Given var fixture = new IssueCheckerFixture(); // When IssueChecker.Check( fixture.Issue, fixture.ProviderType, fixture.ProviderName, fixture.Run, fixture.Identifier, fixture.ProjectFileRelativePath, fixture.ProjectName, fixture.AffectedFileRelativePath, fixture.Line, fixture.EndLine, fixture.Column, fixture.EndColumn, fixture.FileLink, fixture.MessageText, fixture.MessageHtml, fixture.MessageMarkdown, fixture.Priority, fixture.PriorityName, fixture.Rule, fixture.RuleUrl); // Then }
public void Should_Throw_If_Priority_Is_Different(IssuePriority expectedValue, IssuePriority actualValue) { // Given var fixture = new IssueCheckerFixture(); var issue = fixture.IssueBuilder .WithPriority(actualValue) .Create(); // When var result = Record.Exception(() => IssueChecker.Check( issue, fixture.ProviderType, fixture.ProviderName, fixture.ProjectFileRelativePath, fixture.ProjectName, fixture.AffectedFileRelativePath, fixture.Line, fixture.MessageText, fixture.MessageHtml, fixture.MessageMarkdown, (int)expectedValue, fixture.PriorityName, fixture.Rule, fixture.RuleUrl)); // Then result.ShouldBeOfType <Exception>(); result.Message.ShouldStartWith("Expected issue.Priority"); }
public void Should_Not_Throw_If_Issues_Are_Identical() { // Given var fixture = new IssueCheckerFixture(); var issueToCheck = fixture.IssueBuilder.Create(); var expectedIssue = fixture.IssueBuilder; // When IssueChecker.Check(issueToCheck, expectedIssue); // Then }
public void Should_Not_Throw_If_All_Values_Are_The_Same() { // Given var fixture = new IssueCheckerFixture(); // When IssueChecker.Check( fixture.Issue, fixture.ProviderType, fixture.ProviderName, fixture.ProjectFileRelativePath, fixture.ProjectName, fixture.AffectedFileRelativePath, fixture.Line, fixture.Message, fixture.Priority, fixture.PriorityName, fixture.Rule, fixture.RuleUrl); // Then }
public void Should_Throw_If_EndColumn_Is_Different(int?expectedValue, int?actualValue) { // Given var fixture = new IssueCheckerFixture(); var issue = fixture.IssueBuilder .InFile(fixture.AffectedFileRelativePath, fixture.Line, fixture.EndLine, fixture.Column, actualValue) .Create(); // When var result = Record.Exception(() => IssueChecker.Check( issue, fixture.ProviderType, fixture.ProviderName, fixture.Run, fixture.Identifier, fixture.ProjectFileRelativePath, fixture.ProjectName, fixture.AffectedFileRelativePath, fixture.Line, fixture.EndLine, fixture.Column, expectedValue, fixture.FileLink, fixture.MessageText, fixture.MessageHtml, fixture.MessageMarkdown, fixture.Priority, fixture.PriorityName, fixture.Rule, fixture.RuleUrl)); // Then result.ShouldBeOfType <Exception>(); result.Message.ShouldStartWith("Expected issue.EndColumn"); }