From 012f98c1bb4ad4f671f0bca8695005f9723d11d2 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Fri, 8 May 2020 13:28:01 +0200 Subject: [PATCH 1/3] Allow inferring name of test automatically --- .../CompilationTestRunner.cs | 2 +- src/Exercism.TestRunner.CSharp/TestResult.cs | 10 ++++++---- src/Exercism.TestRunner.CSharp/TestRunWriter.cs | 4 ++++ .../expected_results.json | 15 ++++++++++----- .../expected_results.json | 9 ++++++--- .../expected_results.json | 9 ++++++--- .../expected_results.json | 9 ++++++--- .../expected_results.json | 9 ++++++--- .../expected_results.json | 9 ++++++--- .../Solutions/NetCoreApp2.1/expected_results.json | 3 ++- .../Solutions/NetCoreApp2.2/expected_results.json | 3 ++- .../Solutions/NetCoreApp3.0/expected_results.json | 3 ++- .../NotImplemented/expected_results.json | 3 ++- .../SingleTestThatFails/expected_results.json | 3 ++- .../SingleTestThatPasses/expected_results.json | 3 ++- 15 files changed, 63 insertions(+), 31 deletions(-) diff --git a/src/Exercism.TestRunner.CSharp/CompilationTestRunner.cs b/src/Exercism.TestRunner.CSharp/CompilationTestRunner.cs index 5084729..77674ca 100644 --- a/src/Exercism.TestRunner.CSharp/CompilationTestRunner.cs +++ b/src/Exercism.TestRunner.CSharp/CompilationTestRunner.cs @@ -35,7 +35,7 @@ private static async Task Run(IAssemblyInfo assemblyInfo) await assemblyRunner.RunAsync(); var orderedTestNames = testCases.Select(testCase => testCase.DisplayName).ToArray(); - var orderedTestResults = testResults.OrderBy(testResult => Array.IndexOf(orderedTestNames, testResult.Name)).ToArray(); + var orderedTestResults = testResults.OrderBy(testResult => Array.IndexOf(orderedTestNames, testResult.Test)).ToArray(); return TestRun.FromTests(orderedTestResults); } diff --git a/src/Exercism.TestRunner.CSharp/TestResult.cs b/src/Exercism.TestRunner.CSharp/TestResult.cs index 900f4a1..71508d5 100644 --- a/src/Exercism.TestRunner.CSharp/TestResult.cs +++ b/src/Exercism.TestRunner.CSharp/TestResult.cs @@ -1,3 +1,4 @@ +using Humanizer; using Xunit.Abstractions; namespace Exercism.TestRunner.CSharp @@ -5,17 +6,18 @@ namespace Exercism.TestRunner.CSharp internal class TestResult { public string Name { get; } + public string Test { get; } public string Message { get; } public string Output { get; } public TestStatus Status { get; } - private TestResult(string name, TestStatus status, string message, string output) => - (Name, Message, Status, Output) = (name, message, status, output); + private TestResult(string name, string test, TestStatus status, string message, string output) => + (Name, Test, Message, Status, Output) = (name, test, message, status, output); public static TestResult FromPassed(ITestPassed test) => - new TestResult(test.TestCase.DisplayName, TestStatus.Pass, null, test.Output); + new TestResult(test.TestCase.TestMethod.Method.Name.Humanize(), test.TestCase.DisplayName, TestStatus.Pass, null, test.Output); public static TestResult FromFailed(ITestFailed test) => - new TestResult(test.TestCase.DisplayName, TestStatus.Fail, TestRunMessage.FromMessages(test.Messages), test.Output); + new TestResult(test.TestCase.TestMethod.Method.Name.Humanize(), test.TestCase.DisplayName, TestStatus.Fail, TestRunMessage.FromMessages(test.Messages), test.Output); } } \ No newline at end of file diff --git a/src/Exercism.TestRunner.CSharp/TestRunWriter.cs b/src/Exercism.TestRunner.CSharp/TestRunWriter.cs index bf8a187..485cc29 100644 --- a/src/Exercism.TestRunner.CSharp/TestRunWriter.cs +++ b/src/Exercism.TestRunner.CSharp/TestRunWriter.cs @@ -27,6 +27,7 @@ private static JsonTestResult ToJsonTestResult(this TestResult testResult) => new JsonTestResult { Name = testResult.Name, + Test = testResult.Test, Status = testResult.Status.ToString().ToLower(), Message = testResult.Message.ToNullIfEmptyOrWhiteSpace(), Output = testResult.Output.ToNullIfEmptyOrWhiteSpace() @@ -48,6 +49,9 @@ private class JsonTestResult [JsonPropertyName("name")] public string Name { get; set; } + [JsonPropertyName("test")] + public string Test { get; set; } + [JsonPropertyName("status")] public string Status { get; set; } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestClassesWithAllPasses/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestClassesWithAllPasses/expected_results.json index c884ace..18aa0b1 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestClassesWithAllPasses/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestClassesWithAllPasses/expected_results.json @@ -2,23 +2,28 @@ "status": "pass", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "pass" }, { - "name": "FakeTest.Sub_should_subtract_numbers", + "name": "Sub should subtract numbers", + "test": "FakeTest.Sub_should_subtract_numbers", "status": "pass" }, { - "name": "FakeTest.Mul_should_multiply_numbers", + "name": "Mul should multiply numbers", + "test": "FakeTest.Mul_should_multiply_numbers", "status": "pass" }, { - "name": "FooTest.Upper_should_uppercase_string", + "name": "Upper should uppercase string", + "test": "FooTest.Upper_should_uppercase_string", "status": "pass" }, { - "name": "FooTest.Lower_should_lowercase_string", + "name": "Lower should lowercase string", + "test": "FooTest.Lower_should_lowercase_string", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithAllPasses/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithAllPasses/expected_results.json index e467174..979fb4d 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithAllPasses/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithAllPasses/expected_results.json @@ -2,15 +2,18 @@ "status": "pass", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "pass" }, { - "name": "FakeTest.Sub_should_subtract_numbers", + "name": "Sub should subtract numbers", + "test": "FakeTest.Sub_should_subtract_numbers", "status": "pass" }, { - "name": "FakeTest.Mul_should_multiply_numbers", + "name": "Mul should multiply numbers", + "test": "FakeTest.Mul_should_multiply_numbers", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithMultipleFails/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithMultipleFails/expected_results.json index da42eaa..562283b 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithMultipleFails/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithMultipleFails/expected_results.json @@ -2,16 +2,19 @@ "status": "fail", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 3\nActual: 2" }, { - "name": "FakeTest.Sub_should_subtract_numbers", + "name": "Sub should subtract numbers", + "test": "FakeTest.Sub_should_subtract_numbers", "status": "pass" }, { - "name": "FakeTest.Mul_should_multiply_numbers", + "name": "Mul should multiply numbers", + "test": "FakeTest.Mul_should_multiply_numbers", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 7\nActual: 6" } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithSingleFail/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithSingleFail/expected_results.json index 091e887..ab4f436 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithSingleFail/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithSingleFail/expected_results.json @@ -2,15 +2,18 @@ "status": "fail", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "pass" }, { - "name": "FakeTest.Sub_should_subtract_numbers", + "name": "Sub should subtract numbers", + "test": "FakeTest.Sub_should_subtract_numbers", "status": "pass" }, { - "name": "FakeTest.Mul_should_multiply_numbers", + "name": "Mul should multiply numbers", + "test": "FakeTest.Mul_should_multiply_numbers", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 5\nActual: 6" } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutput/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutput/expected_results.json index dba09aa..68454ed 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutput/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutput/expected_results.json @@ -2,16 +2,19 @@ "status": "fail", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "pass", "output": "String without params output" }, { - "name": "FakeTest.Sub_should_subtract_numbers", + "name": "Sub should subtract numbers", + "test": "FakeTest.Sub_should_subtract_numbers", "status": "pass" }, { - "name": "FakeTest.Mul_should_multiply_numbers", + "name": "Mul should multiply numbers", + "test": "FakeTest.Mul_should_multiply_numbers", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 7\nActual: 6", "output": "String with params output\nValues used:\n2, True\n-----" diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutputExceedingLimit/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutputExceedingLimit/expected_results.json index b66e611..be1f423 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutputExceedingLimit/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutputExceedingLimit/expected_results.json @@ -2,16 +2,19 @@ "status": "fail", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "pass", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabc\nOutput was truncated. Please limit to 500 chars." }, { - "name": "FakeTest.Sub_should_subtract_numbers", + "name": "Sub should subtract numbers", + "test": "FakeTest.Sub_should_subtract_numbers", "status": "pass" }, { - "name": "FakeTest.Mul_should_multiply_numbers", + "name": "Mul should multiply numbers", + "test": "FakeTest.Mul_should_multiply_numbers", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 7\nActual: 6", "output": "Maximum not exceeded" diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.1/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.1/expected_results.json index d79b41f..b77d098 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.1/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.1/expected_results.json @@ -2,7 +2,8 @@ "status": "pass", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.2/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.2/expected_results.json index d79b41f..b77d098 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.2/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.2/expected_results.json @@ -2,7 +2,8 @@ "status": "pass", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp3.0/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp3.0/expected_results.json index d79b41f..b77d098 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp3.0/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp3.0/expected_results.json @@ -2,7 +2,8 @@ "status": "pass", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NotImplemented/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NotImplemented/expected_results.json index 72614fe..f93474e 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NotImplemented/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NotImplemented/expected_results.json @@ -2,7 +2,8 @@ "status": "fail", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "fail", "message": "Please implement the Fake.Add method" } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatFails/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatFails/expected_results.json index 4786f39..28dee84 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatFails/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatFails/expected_results.json @@ -2,7 +2,8 @@ "status": "fail", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 3\nActual: 2" } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatPasses/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatPasses/expected_results.json index d79b41f..b77d098 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatPasses/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatPasses/expected_results.json @@ -2,7 +2,8 @@ "status": "pass", "tests": [ { - "name": "FakeTest.Add_should_add_numbers", + "name": "Add should add numbers", + "test": "FakeTest.Add_should_add_numbers", "status": "pass" } ] From 04d22dbe06ab959a92eabff96fd360e3d0922416 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Fri, 8 May 2020 14:19:45 +0200 Subject: [PATCH 2/3] Automatically output expected value --- .../CompilationTestRunner.cs | 17 +++++-- src/Exercism.TestRunner.CSharp/TestResult.cs | 50 ++++++++++++++++--- .../TestRunWriter.cs | 4 ++ .../expected_results.json | 5 ++ .../expected_results.json | 3 ++ .../expected_results.json | 3 ++ .../expected_results.json | 3 ++ .../expected_results.json | 3 ++ .../expected_results.json | 3 ++ .../NetCoreApp2.1/expected_results.json | 1 + .../NetCoreApp2.2/expected_results.json | 1 + .../NetCoreApp3.0/expected_results.json | 1 + .../NotImplemented/expected_results.json | 1 + .../SingleTestThatFails/expected_results.json | 1 + .../expected_results.json | 1 + 15 files changed, 86 insertions(+), 11 deletions(-) diff --git a/src/Exercism.TestRunner.CSharp/CompilationTestRunner.cs b/src/Exercism.TestRunner.CSharp/CompilationTestRunner.cs index 77674ca..5e5d4d6 100644 --- a/src/Exercism.TestRunner.CSharp/CompilationTestRunner.cs +++ b/src/Exercism.TestRunner.CSharp/CompilationTestRunner.cs @@ -17,17 +17,24 @@ internal static class CompilationTestRunner private static readonly TestMessageSink ExecutionMessageSink = new TestMessageSink(); public static async Task Run(Compilation compilation) => - await Run(compilation.Rewrite().ToAssembly().ToAssemblyInfo()); + await Run(compilation.Rewrite().ToAssembly().ToAssemblyInfo(), compilation); - private static async Task Run(IAssemblyInfo assemblyInfo) + private static async Task Run(IAssemblyInfo assemblyInfo, Compilation compilation) { + SyntaxNode GetSyntaxNode(ITestMethod testMethod) + { + var symbol = compilation.GetSymbolsWithName(testMethod.Method.Name, SymbolFilter.Member).FirstOrDefault(); + var syntaxReference = symbol?.DeclaringSyntaxReferences.FirstOrDefault(); + return syntaxReference?.GetSyntax(); + } + var testResults = new List(); - + ExecutionMessageSink.Execution.TestFailedEvent += args => - testResults.Add(TestResult.FromFailed(args.Message)); + testResults.Add(TestResult.FromFailed(args.Message, GetSyntaxNode(args.Message.TestMethod))); ExecutionMessageSink.Execution.TestPassedEvent += args => - testResults.Add(TestResult.FromPassed(args.Message)); + testResults.Add(TestResult.FromPassed(args.Message, GetSyntaxNode(args.Message.TestMethod))); var testCases = TestCases(assemblyInfo); diff --git a/src/Exercism.TestRunner.CSharp/TestResult.cs b/src/Exercism.TestRunner.CSharp/TestResult.cs index 71508d5..12c8cff 100644 --- a/src/Exercism.TestRunner.CSharp/TestResult.cs +++ b/src/Exercism.TestRunner.CSharp/TestResult.cs @@ -1,4 +1,7 @@ +using System.Linq; using Humanizer; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Xunit.Abstractions; namespace Exercism.TestRunner.CSharp @@ -7,17 +10,52 @@ internal class TestResult { public string Name { get; } public string Test { get; } + public string Expected { get; } public string Message { get; } public string Output { get; } public TestStatus Status { get; } - private TestResult(string name, string test, TestStatus status, string message, string output) => - (Name, Test, Message, Status, Output) = (name, test, message, status, output); + private TestResult(string name, string test, string expected, TestStatus status, string message, string output) => + (Name, Test, Expected, Message, Status, Output) = (name, test, expected, message, status, output); - public static TestResult FromPassed(ITestPassed test) => - new TestResult(test.TestCase.TestMethod.Method.Name.Humanize(), test.TestCase.DisplayName, TestStatus.Pass, null, test.Output); + public static TestResult FromPassed(ITestPassed test, SyntaxNode syntaxNode) => + new TestResult(ToName(test.TestCase), ToTest(test.TestCase), ToExpected(syntaxNode), TestStatus.Pass, null, test.Output); - public static TestResult FromFailed(ITestFailed test) => - new TestResult(test.TestCase.TestMethod.Method.Name.Humanize(), test.TestCase.DisplayName, TestStatus.Fail, TestRunMessage.FromMessages(test.Messages), test.Output); + public static TestResult FromFailed(ITestFailed test, SyntaxNode syntaxNode) => + new TestResult(ToName(test.TestCase), ToTest(test.TestCase), ToExpected(syntaxNode), TestStatus.Fail, TestRunMessage.FromMessages(test.Messages), test.Output); + + private static string ToName(ITestCase testCase) => testCase.TestMethod.Method.Name.Humanize(); + + private static string ToTest(ITestCase testCase) => testCase.DisplayName; + + private static string ToExpected(SyntaxNode syntaxNode) + { + var assertExpression = syntaxNode.DescendantNodes() + .OfType() + .FirstOrDefault(invocationExpression => + invocationExpression.Expression is MemberAccessExpressionSyntax memberAccessExpression && + memberAccessExpression.Expression is IdentifierNameSyntax identifierName && + identifierName.Identifier.Text == "Assert"); + + if (assertExpression == null) + return null; + + var memberAccessExpression = (MemberAccessExpressionSyntax)assertExpression.Expression; + var assertionIdentifierName = (IdentifierNameSyntax)memberAccessExpression.Name; + + if (assertionIdentifierName.Identifier.Text == "True") + return "true"; + + if (assertionIdentifierName.Identifier.Text == "False") + return "false"; + + if (assertionIdentifierName.Identifier.Text == "Equal") + return assertExpression.ArgumentList.Arguments[0].ToString(); + + if (assertionIdentifierName.Identifier.Text == "InRange") + return $">= {assertExpression.ArgumentList.Arguments[1]} && <= {assertExpression.ArgumentList.Arguments[2]}"; + + return default; + } } } \ No newline at end of file diff --git a/src/Exercism.TestRunner.CSharp/TestRunWriter.cs b/src/Exercism.TestRunner.CSharp/TestRunWriter.cs index 485cc29..c46c7fe 100644 --- a/src/Exercism.TestRunner.CSharp/TestRunWriter.cs +++ b/src/Exercism.TestRunner.CSharp/TestRunWriter.cs @@ -28,6 +28,7 @@ private static JsonTestResult ToJsonTestResult(this TestResult testResult) => { Name = testResult.Name, Test = testResult.Test, + Expected = testResult.Expected, Status = testResult.Status.ToString().ToLower(), Message = testResult.Message.ToNullIfEmptyOrWhiteSpace(), Output = testResult.Output.ToNullIfEmptyOrWhiteSpace() @@ -52,6 +53,9 @@ private class JsonTestResult [JsonPropertyName("test")] public string Test { get; set; } + [JsonPropertyName("expected")] + public string Expected { get; set; } + [JsonPropertyName("status")] public string Status { get; set; } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestClassesWithAllPasses/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestClassesWithAllPasses/expected_results.json index 18aa0b1..5357072 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestClassesWithAllPasses/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestClassesWithAllPasses/expected_results.json @@ -4,26 +4,31 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "2", "status": "pass" }, { "name": "Sub should subtract numbers", "test": "FakeTest.Sub_should_subtract_numbers", + "expected": "4", "status": "pass" }, { "name": "Mul should multiply numbers", "test": "FakeTest.Mul_should_multiply_numbers", + "expected": "6", "status": "pass" }, { "name": "Upper should uppercase string", "test": "FooTest.Upper_should_uppercase_string", + "expected": "\u0022HELLO\u0022", "status": "pass" }, { "name": "Lower should lowercase string", "test": "FooTest.Lower_should_lowercase_string", + "expected": "\u0022hello\u0022", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithAllPasses/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithAllPasses/expected_results.json index 979fb4d..6c34b6d 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithAllPasses/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithAllPasses/expected_results.json @@ -4,16 +4,19 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "2", "status": "pass" }, { "name": "Sub should subtract numbers", "test": "FakeTest.Sub_should_subtract_numbers", + "expected": "4", "status": "pass" }, { "name": "Mul should multiply numbers", "test": "FakeTest.Mul_should_multiply_numbers", + "expected": "6", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithMultipleFails/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithMultipleFails/expected_results.json index 562283b..2bf5009 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithMultipleFails/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithMultipleFails/expected_results.json @@ -4,17 +4,20 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "3", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 3\nActual: 2" }, { "name": "Sub should subtract numbers", "test": "FakeTest.Sub_should_subtract_numbers", + "expected": "1", "status": "pass" }, { "name": "Mul should multiply numbers", "test": "FakeTest.Mul_should_multiply_numbers", + "expected": "7", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 7\nActual: 6" } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithSingleFail/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithSingleFail/expected_results.json index ab4f436..919f816 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithSingleFail/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithSingleFail/expected_results.json @@ -4,16 +4,19 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "2", "status": "pass" }, { "name": "Sub should subtract numbers", "test": "FakeTest.Sub_should_subtract_numbers", + "expected": "1", "status": "pass" }, { "name": "Mul should multiply numbers", "test": "FakeTest.Mul_should_multiply_numbers", + "expected": "5", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 5\nActual: 6" } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutput/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutput/expected_results.json index 68454ed..6f5044f 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutput/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutput/expected_results.json @@ -4,17 +4,20 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "2", "status": "pass", "output": "String without params output" }, { "name": "Sub should subtract numbers", "test": "FakeTest.Sub_should_subtract_numbers", + "expected": "4", "status": "pass" }, { "name": "Mul should multiply numbers", "test": "FakeTest.Mul_should_multiply_numbers", + "expected": "7", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 7\nActual: 6", "output": "String with params output\nValues used:\n2, True\n-----" diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutputExceedingLimit/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutputExceedingLimit/expected_results.json index be1f423..7d61933 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutputExceedingLimit/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/MultipleTestsWithTestOutputExceedingLimit/expected_results.json @@ -4,17 +4,20 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "2", "status": "pass", "output": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabc\nOutput was truncated. Please limit to 500 chars." }, { "name": "Sub should subtract numbers", "test": "FakeTest.Sub_should_subtract_numbers", + "expected": "4", "status": "pass" }, { "name": "Mul should multiply numbers", "test": "FakeTest.Mul_should_multiply_numbers", + "expected": "7", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 7\nActual: 6", "output": "Maximum not exceeded" diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.1/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.1/expected_results.json index b77d098..2f4f1dc 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.1/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.1/expected_results.json @@ -4,6 +4,7 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "2", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.2/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.2/expected_results.json index b77d098..2f4f1dc 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.2/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp2.2/expected_results.json @@ -4,6 +4,7 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "2", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp3.0/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp3.0/expected_results.json index b77d098..2f4f1dc 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp3.0/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NetCoreApp3.0/expected_results.json @@ -4,6 +4,7 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "2", "status": "pass" } ] diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NotImplemented/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NotImplemented/expected_results.json index f93474e..f32e157 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NotImplemented/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/NotImplemented/expected_results.json @@ -4,6 +4,7 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "3", "status": "fail", "message": "Please implement the Fake.Add method" } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatFails/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatFails/expected_results.json index 28dee84..8599fc0 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatFails/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatFails/expected_results.json @@ -4,6 +4,7 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "3", "status": "fail", "message": "Assert.Equal() Failure\nExpected: 3\nActual: 2" } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatPasses/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatPasses/expected_results.json index b77d098..2f4f1dc 100644 --- a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatPasses/expected_results.json +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/SingleTestThatPasses/expected_results.json @@ -4,6 +4,7 @@ { "name": "Add should add numbers", "test": "FakeTest.Add_should_add_numbers", + "expected": "2", "status": "pass" } ] From 848ef6f4551dd888019464a9f04ec6d9ce0b45aa Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Fri, 8 May 2020 15:49:16 +0200 Subject: [PATCH 3/3] Automatically generate command --- src/Exercism.TestRunner.CSharp/TestResult.cs | 72 ++++++++++++- .../TestRunWriter.cs | 4 + .../Solutions/Expected/Fake.cs | 25 +++++ .../Solutions/Expected/Fake.csproj | 17 +++ .../Solutions/Expected/FakeTest.cs | 100 ++++++++++++++++++ .../Solutions/Expected/expected_results.json | 5 + 6 files changed, 219 insertions(+), 4 deletions(-) create mode 100644 test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/Fake.cs create mode 100644 test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/Fake.csproj create mode 100644 test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/FakeTest.cs create mode 100644 test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/expected_results.json diff --git a/src/Exercism.TestRunner.CSharp/TestResult.cs b/src/Exercism.TestRunner.CSharp/TestResult.cs index 12c8cff..d96d62f 100644 --- a/src/Exercism.TestRunner.CSharp/TestResult.cs +++ b/src/Exercism.TestRunner.CSharp/TestResult.cs @@ -11,18 +11,19 @@ internal class TestResult public string Name { get; } public string Test { get; } public string Expected { get; } + public string Command { get; } public string Message { get; } public string Output { get; } public TestStatus Status { get; } - private TestResult(string name, string test, string expected, TestStatus status, string message, string output) => - (Name, Test, Expected, Message, Status, Output) = (name, test, expected, message, status, output); + private TestResult(string name, string test, string expected, string command, TestStatus status, string message, string output) => + (Name, Test, Expected, Command, Message, Status, Output) = (name, test, expected, command, message, status, output); public static TestResult FromPassed(ITestPassed test, SyntaxNode syntaxNode) => - new TestResult(ToName(test.TestCase), ToTest(test.TestCase), ToExpected(syntaxNode), TestStatus.Pass, null, test.Output); + new TestResult(ToName(test.TestCase), ToTest(test.TestCase), ToExpected(syntaxNode), ToCommand(syntaxNode), TestStatus.Pass, null, test.Output); public static TestResult FromFailed(ITestFailed test, SyntaxNode syntaxNode) => - new TestResult(ToName(test.TestCase), ToTest(test.TestCase), ToExpected(syntaxNode), TestStatus.Fail, TestRunMessage.FromMessages(test.Messages), test.Output); + new TestResult(ToName(test.TestCase), ToTest(test.TestCase), ToExpected(syntaxNode), ToCommand(syntaxNode), TestStatus.Fail, TestRunMessage.FromMessages(test.Messages), test.Output); private static string ToName(ITestCase testCase) => testCase.TestMethod.Method.Name.Humanize(); @@ -57,5 +58,68 @@ memberAccessExpression.Expression is IdentifierNameSyntax identifierName && return default; } + + private static string ToCommand(SyntaxNode syntaxNode) + { + var methodDeclaration = (MethodDeclarationSyntax)syntaxNode; + + var assertExpression = methodDeclaration.DescendantNodes() + .OfType() + .FirstOrDefault(invocationExpression => + invocationExpression.Expression is MemberAccessExpressionSyntax memberAccessExpression && + memberAccessExpression.Expression is IdentifierNameSyntax identifierName && + identifierName.Identifier.Text == "Assert"); + + if (assertExpression == null) + return null; + + var memberAccessExpression = (MemberAccessExpressionSyntax)assertExpression.Expression; + var assertionIdentifierName = (IdentifierNameSyntax)memberAccessExpression.Name; + + if (assertionIdentifierName.Identifier.Text == "True" || + assertionIdentifierName.Identifier.Text == "False") + { + if (methodDeclaration.ExpressionBody != null || + methodDeclaration.Body.Statements.Count == 1) + return assertExpression.ArgumentList.Arguments[0].ToString(); + + return ToCommandStatement(0).ToString(); + } + + if (assertionIdentifierName.Identifier.Text == "Equal") + { + if (methodDeclaration.ExpressionBody != null || + methodDeclaration.Body.Statements.Count == 1) + return assertExpression.ArgumentList.Arguments[1].ToString(); + + return ToCommandStatement(1).ToString(); + } + + if (assertionIdentifierName.Identifier.Text == "InRange") + { + if (methodDeclaration.ExpressionBody != null || + methodDeclaration.Body.Statements.Count == 1) + return assertExpression.ArgumentList.Arguments[2].ToString(); + + return ToCommandStatement(0).ToString(); + } + + return default; + + SyntaxList ToCommandStatement(int argumentIndex) + { + var commandExpression = methodDeclaration.Body + .ReplaceNode(assertExpression, assertExpression.ArgumentList.Arguments[argumentIndex].Expression); + + for (var i = 0; i < commandExpression.Statements.Count; i++) + { + commandExpression = commandExpression.ReplaceNode( + commandExpression.Statements[i], commandExpression.Statements[i].WithoutLeadingTrivia()); + } + + return commandExpression + .Statements; + } + } } } \ No newline at end of file diff --git a/src/Exercism.TestRunner.CSharp/TestRunWriter.cs b/src/Exercism.TestRunner.CSharp/TestRunWriter.cs index c46c7fe..9591f6f 100644 --- a/src/Exercism.TestRunner.CSharp/TestRunWriter.cs +++ b/src/Exercism.TestRunner.CSharp/TestRunWriter.cs @@ -29,6 +29,7 @@ private static JsonTestResult ToJsonTestResult(this TestResult testResult) => Name = testResult.Name, Test = testResult.Test, Expected = testResult.Expected, + Command = testResult.Command, Status = testResult.Status.ToString().ToLower(), Message = testResult.Message.ToNullIfEmptyOrWhiteSpace(), Output = testResult.Output.ToNullIfEmptyOrWhiteSpace() @@ -56,6 +57,9 @@ private class JsonTestResult [JsonPropertyName("expected")] public string Expected { get; set; } + [JsonPropertyName("command")] + public string Command { get; set; } + [JsonPropertyName("status")] public string Status { get; set; } diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/Fake.cs b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/Fake.cs new file mode 100644 index 0000000..c0cedf6 --- /dev/null +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/Fake.cs @@ -0,0 +1,25 @@ +public class Fake +{ + private readonly int x; + + public Fake(int x) + { + this.x = x; + } + + public int Invert() => -x; + + public bool Positive() => x >= 0; + + public string Describe() => $"Number: {x}"; + + public void Foo() + { + } + + public static int Invert(int x) => -x; + + public static bool Positive(int x) => x >= 0; + + public static string Describe(int x) => $"Number: {x}"; +} \ No newline at end of file diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/Fake.csproj b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/Fake.csproj new file mode 100644 index 0000000..d9555be --- /dev/null +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/Fake.csproj @@ -0,0 +1,17 @@ + + + + netcoreapp3.1 + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/FakeTest.cs b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/FakeTest.cs new file mode 100644 index 0000000..fbf29bf --- /dev/null +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/FakeTest.cs @@ -0,0 +1,100 @@ +using Xunit; + +public class FakeExpressionBodies +{ + [Fact] + public void Test_Using_Assert_Equal_In_Expression_Body_With_Expected_Int() => + Assert.Equal(-5, Fake.Invert(5)); + + [Fact] + public void Test_Using_Assert_Equal_In_Expression_Body_With_Expected_String() => + Assert.Equal("Number: 7", Fake.Describe(7)); + + [Fact] + public void Test_Using_Assert_In_Range_In_Expression_Body_With_Expected_Int() => + Assert.InRange(Fake.Invert(-5), 3, 7); + + [Fact] + public void Test_Using_Assert_True_In_Expression_Body() => + Assert.True(Fake.Positive(1)); + + [Fact] + public void Test_Using_Assert_False_In_Expression_Body() => + Assert.False(Fake.Positive(-2)); +} + +public class FakeSingleLineStatements +{ + [Fact] + public void Test_Using_Assert_Equal_In_Single_Line_Statement_With_Expected_Int() + { + Assert.Equal(-5, Fake.Invert(5)); + } + + [Fact] + public void Test_Using_Assert_Equal_In_Single_Line_Statement_With_Expected_String() + { + Assert.Equal("Number: 7", Fake.Describe(7)); + } + + [Fact] + public void Test_Using_Assert_In_Range_In_Single_line_With_Expected_Int() + { + Assert.InRange(Fake.Invert(-5), 3, 7); + } + + [Fact] + public void Test_Using_Assert_True_In_Single_Line_Statement() + { + Assert.True(Fake.Positive(1)); + } + + [Fact] + public void Test_Using_Assert_False_In_Single_Line_Statement() + { + Assert.False(Fake.Positive(-2)); + } +} + +public class FakeMultiLineStatements +{ + [Fact] + public void Test_Using_Assert_Equal_In_Multi_Line_Statement_With_Expected_Int() + { + var fake = new Fake(3); + fake.Foo(); + Assert.Equal(-3, fake.Invert()); + } + + [Fact] + public void Test_Using_Assert_Equal_In_Multi_Line_Statement_With_Expected_String() + { + var fake = new Fake(9); + fake.Foo(); + Assert.Equal("Number: 9", fake.Describe()); + } + + [Fact] + public void Test_Using_Assert_In_Range_In_Single_line_With_Expected_Int() + { + var fake = new Fake(9); + fake.Foo(); + Assert.InRange(fake.Invert(), 3, 7); + } + + [Fact] + public void Test_Using_Assert_True_In_Multi_Line_Statement() + { + var fake = new Fake(6); + fake.Foo(); + Assert.True(fake.Positive()); + } + + [Fact] + public void Test_Using_Assert_False_In_Multi_Line_Statement() + { + var fake = new Fake(-8); + fake.Foo(); + Assert.False(fake.Positive()); + } +} \ No newline at end of file diff --git a/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/expected_results.json b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/expected_results.json new file mode 100644 index 0000000..d5b14e3 --- /dev/null +++ b/test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/Expected/expected_results.json @@ -0,0 +1,5 @@ +{ + "status": "error", + "message": "FakeTest.cs:75: Member \u0027Fake.Add(int, int)\u0027 cannot be accessed with an instance reference; qualify it with a type name instead\nFakeTest.cs:83: Member \u0027Fake.Add(int, int)\u0027 cannot be accessed with an instance reference; qualify it with a type name instead\nFakeTest.cs:91: Member \u0027Fake.Describe(int)\u0027 cannot be accessed with an instance reference; qualify it with a type name instead\nFakeTest.cs:99: Member \u0027Fake.Describe(int)\u0027 cannot be accessed with an instance reference; qualify it with a type name instead\nFakeTest.cs:107: Member \u0027Fake.Positive(int)\u0027 cannot be accessed with an instance reference; qualify it with a type name instead\nFakeTest.cs:115: Member \u0027Fake.Positive(int)\u0027 cannot be accessed with an instance reference; qualify it with a type name instead", + "tests": [] +} \ No newline at end of file