Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski committed Apr 16, 2024
1 parent 5875133 commit ceb5cf4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="protobuf-net" Version="3.0.101" />
<PackageReference Include="Zebus.Contracts" Version="3.0.0" />
<PackageReference Include="protobuf-net" Version="3.2.30" />
<PackageReference Include="Zebus.Contracts" Version="3.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="protobuf-net" Version="3.0.101" />
<PackageReference Include="Zebus.Contracts" Version="3.0.0" />
<PackageReference Include="protobuf-net" Version="3.2.30" />
<PackageReference Include="Zebus.Contracts" Version="3.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Moq" Version="4.18.1"/>
<PackageReference Include="NUnit" Version="4.0.1"/>
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageReference Include="NUnit" Version="4.0.1"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
<PackageReference Include="Verify.NUnit" Version="22.11.5" />
<PackageReference Include="Verify.NUnit" Version="24.1.0" />
<PackageReference Include="Verify.DiffPlex" Version="*" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Abc.Zebus.MessageDsl.Analysis;
using Abc.Zebus.MessageDsl.Ast;
using Abc.Zebus.MessageDsl.Tests.TestTools;
using JetBrains.Annotations;
using NUnit.Framework;

namespace Abc.Zebus.MessageDsl.Tests.MessageDsl;
Expand Down Expand Up @@ -223,6 +224,7 @@ public void should_detect_invalid_tags()
[Test]
public void should_detect_invalid_parameters()
{
ParseInvalid("FooExecuted(int a,)");
ParseInvalid("FooExecuted(int a, int a)");
ParseInvalid("FooExecuted([0] int a)");
ParseInvalid("FooExecuted([ProtoMember(0)] int a)");
Expand Down Expand Up @@ -712,6 +714,7 @@ public void should_generate_ast_for_incomplete_code()
[TestCase("Foo(int")]
[TestCase("Foo(int;")]
[TestCase("Foo(int first")]
[TestCase("Foo(int first,)")]
[TestCase("Foo(int first;")]
[TestCase("Foo(int first,")]
[TestCase("Foo(int first,;")]
Expand Down Expand Up @@ -857,7 +860,7 @@ public bool should_validate_attribute_targets(string definitionText)
public void should_handle_errors(string definitionText)
=> Parse(definitionText);

private static ParsedContracts ParseValid(string definitionText)
private static ParsedContracts ParseValid([LanguageInjection("csharp")] string definitionText)
{
var contracts = Parse(definitionText);

Expand All @@ -867,7 +870,7 @@ private static ParsedContracts ParseValid(string definitionText)
return contracts;
}

private static ParsedContracts ParseInvalid(string definitionText)
private static ParsedContracts ParseInvalid([LanguageInjection("csharp")] string definitionText)
{
var contracts = Parse(definitionText);

Expand All @@ -877,7 +880,7 @@ private static ParsedContracts ParseInvalid(string definitionText)
return contracts;
}

private static ParsedContracts Parse(string definitionText)
private static ParsedContracts Parse([LanguageInjection("csharp")] string definitionText)
{
Console.WriteLine();
Console.WriteLine("PARSE: {0}", definitionText);
Expand Down

0 comments on commit ceb5cf4

Please sign in to comment.