/Eco.Tests.csproj Secret
Created
November 14, 2021 21:23
Incorrect format for TestCaseFilter Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<ProjectGuid>{7F353C23-C53A-41CC-9E3E-4162AC5441CF}</ProjectGuid> | |
<TargetFramework>net5.0-windows</TargetFramework> | |
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | |
<AssemblyTitle>Tests</AssemblyTitle> | |
<Product>Tests</Product> | |
<Copyright>Copyright © 2019</Copyright> | |
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | |
<CodeAnalysisRuleSet>..\..\Eco.ruleset</CodeAnalysisRuleSet> | |
<DebugType>portable</DebugType> | |
<IsPackable>false</IsPackable> | |
<LangVersion>9</LangVersion> | |
<Platforms>x64;x86</Platforms> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="NUnit" Version="3.13.1" /> | |
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" /> | |
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> | |
<PrivateAssets>all</PrivateAssets> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
</PackageReference> | |
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> | |
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" /> | |
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" /> | |
</ItemGroup> | |
<ItemGroup> | |
<ProjectReference Include="..\Eco.Core\Eco.Core.csproj" /> | |
<ProjectReference Include="..\Eco.Gameplay\Eco.Gameplay.csproj" /> | |
<ProjectReference Include="..\Eco.ModKit\Eco.ModKit.csproj" /> | |
<ProjectReference Include="..\Eco.Mods\Eco.Mods.csproj" /> | |
<ProjectReference Include="..\Eco.Networking.ENet\Eco.Networking.ENet.csproj" /> | |
<ProjectReference Include="..\Eco.Plugins\Eco.Plugins.csproj" /> | |
<ProjectReference Include="..\Eco.Server\Eco.Server.csproj" /> | |
<ProjectReference Include="..\Eco.Shared\Eco.Shared.csproj" /> | |
<ProjectReference Include="..\Eco.Simulation\Eco.Simulation.csproj" /> | |
<ProjectReference Include="..\Eco.Stats\Eco.Stats.csproj" /> | |
<ProjectReference Include="..\Eco.WorldGenerator\Eco.WorldGenerator.csproj" /> | |
<ProjectReference Include="..\Eco.World\Eco.World.csproj" /> | |
</ItemGroup> | |
<ItemGroup> | |
<None Include="..\..\Eco.ruleset"> | |
<Link>Eco.ruleset</Link> | |
</None> | |
</ItemGroup> | |
<ItemGroup> | |
<AdditionalFiles Include="..\..\stylecop.json"> | |
<Link>stylecop.json</Link> | |
</AdditionalFiles> | |
</ItemGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Building Test Projects | |
========== Starting test run ========== | |
Incorrect format for TestCaseFilter Error: Missing '('. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed. | |
NUnit Adapter 4.1.0.0: Test execution started | |
An exception occurred while invoking executor 'executor://nunit3testexecutor/': Incorrect format for TestCaseFilter Error: Missing '('. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed. | |
Stack trace: | |
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Discovery.DiscoveryContext.GetTestCaseFilter(IEnumerable`1 supportedProperties, Func`2 propertyProvider) | |
at NUnit.VisualStudio.TestAdapter.VsTestFilter.get_TfsTestCaseFilterExpression() in D:\repos\NUnit\nunit3-vs-adapter\src\NUnitTestAdapter\VsTestFilter.cs:line 100 | |
at NUnit.VisualStudio.TestAdapter.VsTestFilter.get_IsEmpty() in D:\repos\NUnit\nunit3-vs-adapter\src\NUnitTestAdapter\VsTestFilter.cs:line 102 | |
at NUnit.VisualStudio.TestAdapter.NUnit3TestExecutor.InitializeForExecution(IRunContext runContext, IFrameworkHandle frameworkHandle) in D:\repos\NUnit\nunit3-vs-adapter\src\NUnitTestAdapter\NUnit3TestExecutor.cs:line 248 | |
at NUnit.VisualStudio.TestAdapter.NUnit3TestExecutor.RunTests(IEnumerable`1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) in D:\repos\NUnit\nunit3-vs-adapter\src\NUnitTestAdapter\NUnit3TestExecutor.cs:line 105 | |
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithSources.InvokeExecutor(LazyExtension`2 executor, Tuple`2 executorUriExtensionTuple, RunContext runContext, IFrameworkHandle frameworkHandle) | |
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable`1 executorUriExtensionMap, Int64 totalTests) | |
========== Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 131 ms ========== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test Duration Traits Error Message | |
Class: WorldAreaTests Not Run (18) | |
Test Group: Eco.Tests.WorldAreaTests.TestWrappedAreas-,[-,-]) Not Run (4) | |
TestWrappedAreas((0, -10)-(100, 10),[(0, 0)-(100, 10), (0, 90)-(100, 100)]) Not Run | |
TestWrappedAreas((-10, 0)-(10, 100),[(0, 0)-(10, 100), (90, 0)-(100, 100)]) Not Run | |
TestWrappedAreas((-10, 10)-(10, 90),[(0, 10)-(10, 90), (90, 10)-(100, 90)]) Not Run | |
TestWrappedAreas((10, -10)-(90, 10),[(10, 0)-(90, 10), (10, 90)-(90, 100)]) Not Run | |
Test Group: Eco.Tests.WorldAreaTests.TestWrappedAreas-,[]) Not Run (5) | |
TestWrappedAreas((0, 0)-(0, 0),[]) Not Run | |
TestWrappedAreas((0, 100)-(100, 100),[]) Not Run | |
TestWrappedAreas((100, 0)-(100, 100),[]) Not Run | |
TestWrappedAreas((100, 100)-(100, 100),[]) Not Run | |
TestWrappedAreas((50, 50)-(50, 50),[]) Not Run | |
Test Group: Eco.Tests.WorldAreaTests.TestWrappedAreas-,[-]) Not Run (6) | |
TestWrappedAreas((0, 0)-(100, 100),[(0, 0)-(100, 100)]) Not Run | |
TestWrappedAreas((0, 0)-(50, 50),[(0, 0)-(50, 50)]) Not Run | |
TestWrappedAreas((-10, -10)-(110, 110),[(0, 0)-(100, 100)]) Not Run | |
TestWrappedAreas((-100, -100)-(0, 0),[(0, 0)-(100, 100)]) Not Run | |
TestWrappedAreas((40, 40)-(90, 90),[(40, 40)-(90, 90)]) Not Run | |
TestWrappedAreas((50, 50)-(100, 100),[(50, 50)-(100, 100)]) Not Run | |
TestSimpleRange Not Run | |
TestWrappedAreas Not Run | |
TestWrappedAreas((-10, -10)-(10, 10),[(0, 0)-(10, 10), (90, 90)-(100, 100), (90, 0)-(100, 10), (0, 90)-(10, 100)]) Not Run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Strange Loop Games. All rights reserved. | |
// See LICENSE file in the project root for full license information. | |
namespace Eco.Tests | |
{ | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using Eco.Shared.Math; | |
using NUnit.Framework; | |
public class WorldAreaTests | |
{ | |
[SetUp] | |
public void Setup() | |
{ | |
Shared.Voxel.World.Initialize(new DummyWorld(new Vector3i(100, 140, 100))); | |
} | |
[Test] | |
public void TestSimpleRange() | |
{ | |
var area = new WorldArea(new Vector2i(10, 20), new Vector2i(20, 30)); | |
Assert.AreEqual(area.Width, 10); | |
Assert.AreEqual(area.Length, 10); | |
Assert.AreEqual(area.Area, 100); | |
Assert.AreEqual(area.Size, new Vector2i(10, 10)); | |
var sameArea = new WorldArea(area.MinInclusive, area.MaxExclusive); | |
Assert.AreEqual(area, sameArea); | |
Assert.IsTrue(area.Contains(sameArea)); | |
Assert.IsTrue(area.Intersects(sameArea)); | |
Assert.AreEqual(area.Intersect(sameArea), area); | |
Assert.AreEqual(area.Center, new Vector2(15, 25)); | |
} | |
static WorldArea WA(int minX, int minY, int maxX, int maxY) => new(new(minX, minY), new(maxX, maxY)); | |
static IEnumerable WrappedAreas() | |
{ | |
yield return new object[] { WA(0, 0, 0, 0), Array.Empty<WorldArea>() }; | |
yield return new object[] { WA(50, 50, 50, 50), Array.Empty<WorldArea>() }; | |
yield return new object[] { WA(100, 100, 100, 100), Array.Empty<WorldArea>() }; | |
yield return new object[] { WA(100, 0, 100, 100), Array.Empty<WorldArea>() }; | |
yield return new object[] { WA(0, 100, 100, 100), Array.Empty<WorldArea>() }; | |
yield return new object[] { WA(0, 0, 100, 100), new[] { WA(0, 0, 100, 100) } }; | |
yield return new object[] { WA(-100, -100, 0, 0), new[] { WA(0, 0, 100, 100) } }; | |
yield return new object[] { WA(-10, -10, 110, 110), new[] { WA(0, 0, 100, 100) } }; | |
yield return new object[] { WA(0, 0, 50, 50), new[] { WA(0, 0, 50, 50) } }; | |
yield return new object[] { WA(50, 50, 100, 100), new[] { WA(50, 50, 100, 100) } }; | |
yield return new object[] { WA(40, 40, 90, 90), new[] { WA(40, 40, 90, 90) } }; | |
yield return new object[] { WA(40, 40, 90, 90), new[] { WA(40, 40, 90, 90) } }; | |
yield return new object[] { WA(-10, 0, 10, 100), new[] { WA(0, 0, 10, 100), WA(90, 0, 100, 100) } }; | |
yield return new object[] { WA(-10, 10, 10, 90), new[] { WA(0, 10, 10, 90), WA(90, 10, 100, 90) } }; | |
yield return new object[] { WA(0, -10, 100, 10), new[] { WA(0, 0, 100, 10), WA(0, 90, 100, 100) } }; | |
yield return new object[] { WA(10, -10, 90, 10), new[] { WA(10, 0, 90, 10), WA(10, 90, 90, 100) } }; | |
yield return new object[] { WA(-10, -10, 10, 10), new[] { WA(0, 0, 10, 10), WA(90, 90, 100, 100), WA(90, 0, 100, 10), WA(0, 90, 10, 100) } }; | |
} | |
[TestCaseSource(nameof(WrappedAreas))] | |
public void TestWrappedAreas(WorldArea unwrapped, WorldArea[] wrappedAreas) | |
{ | |
var size = new Vector2i(100, 100); | |
Assert.That(unwrapped.WrappedAreas(size), Is.EquivalentTo(wrappedAreas)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment