Skip to content

Commit

Permalink
Merge pull request #11 from chickensoft-games/chore/updates
Browse files Browse the repository at this point in the history
fix: update project and start resolution at node's parent, not node itself
  • Loading branch information
jolexxa authored May 3, 2024
2 parents 3f033bb + cda4cf9 commit 307b140
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 28 deletions.
14 changes: 4 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"[csharp]": {
"editor.codeActionsOnSave": {
"source.addMissingImports": true,
"source.fixAll": true,
"source.organizeImports": true
"source.addMissingImports": "explicit",
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
Expand Down Expand Up @@ -137,12 +137,6 @@
"markdownlint.ignore": [
"**/LICENSE"
],
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableMsBuildLoadProjectsOnDemand": false,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.maxFindSymbolsItems": 3000,
"omnisharp.organizeImportsOnFormat": true,
"omnisharp.useModernNet": true,
// Remove these if you're happy with your terminal profiles.
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.profiles.windows": {
Expand All @@ -163,4 +157,4 @@
}
},
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true
}
}
15 changes: 10 additions & 5 deletions Chickensoft.AutoInject.Tests/Chickensoft.AutoInject.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Godot.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
Expand All @@ -14,18 +14,23 @@
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Chickensoft.GoDotTest" Version="1.1.7" />
<PackageReference Include="GodotTestDriver" Version="2.1.0" />
<Compile Include="../Chickensoft.AutoInject/src/**/*.cs" Link="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Chickensoft.GoDotTest" Version="1.4.0" />
<PackageReference Include="Chickensoft.GodotTestDriver" Version="3.0.0" />
<!-- Bring your own assertion library for tests! -->
<!-- We're using Shouldly for this example, but you can use anything. -->
<PackageReference Include="Shouldly" Version="4.1.0" />
<!-- LightMock is a mocking library that can run without reflection. -->
<PackageReference Include="LightMock.Generator" Version="1.2.2" />
<!-- LightMoq is a Chickensoft package which makes it more like Moq. -->
<PackageReference Include="LightMoq" Version="0.1.0" />
<PackageReference Include="Chickensoft.SuperNodes" Version="1.2.0" PrivateAssets="all" OutputItemType="analyzer" />
<PackageReference Include="Chickensoft.SuperNodes.Types" Version="1.2.0" />
<PackageReference Include="Chickensoft.SuperNodes" Version="1.8.0" PrivateAssets="all" OutputItemType="analyzer" />
<PackageReference Include="Chickensoft.SuperNodes.Types" Version="1.8.0" />
<!-- Include project to test. -->
<!-- <PackageReference Include="Chickensoft.AutoInject" Version="1.0.0" PrivateAssets="all" /> -->
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Chickensoft.AutoInject.Tests/badges/branch_coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Chickensoft.AutoInject.Tests/badges/line_coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Chickensoft.AutoInject.Tests/src/Dependent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ ImmutableDictionary<string, ScriptPropertyOrField> dependenciesToResolve
var shouldResolve = true;
var remainingDependencies =
new HashSet<ScriptPropertyOrField>(dependenciesToResolve.Values);
var node = (Node)dependent;

var node = ((Node)dependent).GetParent();
var foundDependencies = new HashSet<ScriptPropertyOrField>();
var providersInitializing = 0;

Expand Down
8 changes: 5 additions & 3 deletions Chickensoft.AutoInject.Tests/test/Tests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
namespace Chickensoft.AutoInject.Tests;

using System.Reflection;
using Chickensoft.GoDotTest;
using Godot;
using GoDotTest;

public partial class Tests : Node2D {
public override void _Ready()
=> _ = GoTest.RunTests(Assembly.GetExecutingAssembly(), this);
public override void _Ready() => CallDeferred(MethodName.RunTests);

public void RunTests() =>
GoTest.RunTests(Assembly.GetExecutingAssembly(), this);
}
2 changes: 1 addition & 1 deletion Chickensoft.AutoInject.Tests/test/src/MiscTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void DependentStubs() {
public void DependencyPendingCancels() {
var provider = new StringProvider();
var initialized = false;
var onInitialized = void (IProvider provider) => initialized = true;
void onInitialized(IProvider provider) => initialized = true;

provider.ProviderState.OnInitialized += onInitialized;

Expand Down
7 changes: 4 additions & 3 deletions Chickensoft.AutoInject.Tests/test/src/MultiResolutionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public class MultiResolutionTest : TestClass {
public MultiResolutionTest(Node testScene) : base(testScene) { }

[Setup]
public async Task Setup() {
public void Setup() {
_fixture = new Fixture(TestScene.GetTree());
_provider = await _fixture.LoadAndAddScene<MultiProvider>(
_provider = _fixture.LoadScene<MultiProvider>(
"res://test/fixtures/MultiProvider.tscn"
);
}
Expand All @@ -28,8 +28,9 @@ public async Task Setup() {

[Test]
public async Task MultiDependentSubscribesToMultiProviderCorrectly() {
await _fixture.AddToRoot(_provider);
await _provider.WaitForEvents();
_provider.Child.ReadyCalled.ShouldBeTrue();
await TestScene.ProcessFrame(2);
_provider.Child.OnResolvedCalled.ShouldBeTrue();
}
}
Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "6.0.407",
"version": "8.0.100",
"rollForward": "latestMinor"
},
"msbuild-sdks": {
"Godot.NET.Sdk": "4.0.4"
"Godot.NET.Sdk": "4.2.2"
}
}
}

0 comments on commit 307b140

Please sign in to comment.