Skip to content

Commit

Permalink
updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
abbasc52 committed Nov 25, 2023
1 parent 178248b commit 51f9110
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 10 deletions.
2 changes: 1 addition & 1 deletion benchmark/RulesEngineBenchmark/RulesEngineBenchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.6" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<!--<PackageReference Include="RulesEngine" Version="3.0.2" />-->
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions src/RulesEngine/RulesEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
<Version>5.0.2</Version>
<Version>5.0.3-preview.1</Version>
<Copyright>Copyright (c) Microsoft Corporation.</Copyright>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://github.com/microsoft/RulesEngine</PackageProjectUrl>
Expand Down Expand Up @@ -33,12 +33,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FastExpressionCompiler" Version="[3.3.3]" />
<PackageReference Include="FluentValidation" Version="11.5.2" />
<PackageReference Include="FastExpressionCompiler" Version="4.0.1" />
<PackageReference Include="FluentValidation" Version="11.8.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Linq" Version="4.3.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.3" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.7" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion test/RulesEngine.UnitTest/CaseSensitiveTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public class CaseSensitiveTests
[Theory]
[InlineData(true,true,false)]
[InlineData(false,true,true)]

public async Task CaseSensitiveTest(bool caseSensitive, bool expected1, bool expected2)
{
var reSettings = new ReSettings {
Expand Down Expand Up @@ -46,5 +45,9 @@ public async Task CaseSensitiveTest(bool caseSensitive, bool expected1, bool exp
Assert.Equal(expected1, result[0].IsSuccess);
Assert.Equal(expected2, result[1].IsSuccess);
}




}
}
8 changes: 4 additions & 4 deletions test/RulesEngine.UnitTest/RulesEngine.UnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.18.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="System.Text.Json" Version="7.0.3" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
52 changes: 52 additions & 0 deletions test/RulesEngine.UnitTest/TypedClassTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,57 @@ public async Task TypedClassTest()
Assert.All(result, (res) => Assert.True(res.IsSuccess));

}


[Fact]
public async Task TypedClassInputSameNameAsTypeTest()
{
Workflow workflow = new() {
WorkflowName = "Conferimento",
Rules = new Rule[] {
new() {
RuleName = "Attore Da",
Enabled = true,
ErrorMessage = "Attore Da Id must be defined",
SuccessEvent = "10",
RuleExpressionType = RuleExpressionType.LambdaExpression,
Expression = "transazione.Attori.Any(a => a.RuoloAttore == 1)",
},
new() {
RuleName = "Attore A",
Enabled = true,
ErrorMessage = "Attore A must be defined",
SuccessEvent = "10",
RuleExpressionType = RuleExpressionType.LambdaExpression,
Expression = "transazione.Attori != null",
},
}
};
var reSettings = new ReSettings() {
CustomTypes = new Type[] {
typeof(Transazione)
}
};
var re = new RulesEngine(reSettings);
re.AddWorkflow(workflow);

var param = new Transazione {
Attori = new List<Attore>{
new Attore{
RuoloAttore = RuoloAttore.B,

},
new Attore {
RuoloAttore = RuoloAttore.C
}
}

};

var result = await re.ExecuteAllRulesAsync("Conferimento", new RuleParameter("Transazione", param));

Assert.All(result, (res) => Assert.True(res.IsSuccess));

}
}
}

0 comments on commit 51f9110

Please sign in to comment.