Skip to content

Commit

Permalink
#23: Clean up of Synergy.Behaviours.Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinCelej committed May 15, 2023
1 parent 19a6130 commit 9ece583
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
3 changes: 3 additions & 0 deletions Behaviours/Synergy.Behaviours.Testing/!Init.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Synergy.Behaviours.Testing;

// TODO: Marcin Celej [from: Marcin Celej on: 14-05-2023]: Support net7.0
7 changes: 3 additions & 4 deletions Behaviours/Synergy.Behaviours.Testing/FeatureGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ public static string Generate<TBehaviour>(
code.AppendLine($"namespace {featureClass.GetType().Namespace};");
code.AppendLine();
code.AppendLine(
$"[GeneratedCode(\"{typeof(FeatureGenerator).Assembly.FullName}\", " +
$"[GeneratedCode(\"{typeof(FeatureGenerator).Assembly.GetName().Name}\", " +
$"\"{typeof(FeatureGenerator).Assembly.GetName().Version?.ToString()}\")]"
);
code.AppendLine($"public partial class {className}");
code.AppendLine($"partial class {className}");
code.AppendLine("{");

Scenario? scenario = null;
Expand Down Expand Up @@ -114,6 +114,7 @@ public static string Generate<TBehaviour>(
continue;
}

// TODO: Marcin Celej [from: Marcin Celej on: 15-05-2023]: check if tags above Rule will work
var rule = Regex.Match(line, "\\s*Rule\\: (.*)");
if (rule.Success)
{
Expand Down Expand Up @@ -273,8 +274,6 @@ void CloseScenario()

code.AppendLine(" }");
code.AppendLine();

code.AppendLine();
}

scenario = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Technical Debt for Synergy.Contracts

Total: 2
Total: 4

## [!Init.cs](../../../Synergy.Behaviours.Testing/!Init.cs)
- TODO: Marcin Celej [from: Marcin Celej on: 14-05-2023]: Support net7.0

## [FeatureGenerator.cs](../../../Synergy.Behaviours.Testing/FeatureGenerator.cs)
- TODO: Marcin Celej [from: Marcin Celej on: 10-05-2023]: Add include / exclude as functions
- TODO: Marcin Celej [from: Marcin Celej on: 15-05-2023]: check if tags above Rule will work
- TODO: Marcin Celej [from: Marcin Celej on: 10-05-2023]: Support Scenario Outline along with Examples
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

namespace Synergy.Behaviours.Tests.Samples;

[GeneratedCode("Synergy.Behaviours.Testing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", "1.0.0.0")]
public partial class CalculatorFeature
[GeneratedCode("Synergy.Behaviours.Testing", "1.0.0.0")]
partial class CalculatorFeature
{
private void CalculatorBackground() // Background:
{
Expand All @@ -27,7 +27,6 @@ public void AddTwoNumbers() // Scenario: Add two numbers
Moreover().AfterAddTwoNumbers();
}


[Xunit.Fact]
// @Add
public void AddTwoNumbersInDifferentWay() // Scenario: Add two numbers in different way
Expand All @@ -41,7 +40,6 @@ public void AddTwoNumbersInDifferentWay() // Scenario: Add two numbers in differ
Then().TheResultShouldBe120(); // Then the result should be 120
}


// Rule: Subtracting numbers

// Rule: Dividing numbers
Expand Down
4 changes: 2 additions & 2 deletions Behaviours/Synergy.Behaviours.Tests/Samples/New.Feature.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9ece583

Please sign in to comment.