Skip to content

Commit

Permalink
Updated dependency versions
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandKoenig committed Dec 30, 2023
1 parent 35b7d6e commit bd82582
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 37 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Build and test
shell: pwsh
working-directory: ./scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="Avalonia.Headless" Version="11.0.6" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.6" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.6" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.6" />
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="Bogus" Version="35.2.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions src/RolandK.AvaloniaExtensions.Tests/Mvvm/MvvmWindowTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ await UnitTestApplication.RunInApplicationContextAsync(() =>
[Fact]
public async Task Attach_MvvmWindow_to_ViewModel_then_close_using_ViewModel_with_dialog_result()
{
await UnitTestApplication.RunInApplicationContextAsync(() =>
await UnitTestApplication.RunInApplicationContextAsync(async Task () =>
{
// Arrange
var testViewModel = new TestViewModel();
Expand All @@ -76,9 +76,11 @@ await UnitTestApplication.RunInApplicationContextAsync(() =>
var dialogResult = new object();
testViewModel.TriggerCloseWindowRequest(dialogResult);

var showDialogTaskResult = await showDialogTask;

// Assert
Assert.Equal(TaskStatus.RanToCompletion, showDialogTask.Status);
Assert.Equal(dialogResult, showDialogTask.Result);
Assert.Equal(dialogResult, showDialogTaskResult);
Assert.False(mvvmWindow.IsVisible);
Assert.Null(testViewModel.AssociatedView);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

<ItemGroup>
<PackageReference Include="Avalonia.Headless" Version="11.0.6" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
44 changes: 31 additions & 13 deletions src/RolandK.AvaloniaExtensions.Tests/Util/UnitTestApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,27 @@ public static async Task RunInApplicationContextAsync(Action? action = null)
return;
}

var taskComplSource = new TaskCompletionSource();
var uiThread = new Thread(_ =>
{
AppBuilder.Configure<UnitTestApplication>()
.LogToTrace()
.UseHeadless(new AvaloniaHeadlessPlatformOptions())
.AfterSetup(_ => taskComplSource.SetResult())
.StartWithClassicDesktopLifetime(Array.Empty<string>(), ShutdownMode.OnExplicitShutdown);
});
uiThread.Start();

await taskComplSource.Task;

await StartApplicationAsync();

if (action != null)
{
await Dispatcher.UIThread.InvokeAsync(action);
}
}

public static async Task RunInApplicationContextAsync(Func<Task> asyncAction)
{
if (Application.Current != null)
{
await Dispatcher.UIThread.InvokeAsync(asyncAction);
return;
}

await StartApplicationAsync();

await Dispatcher.UIThread.InvokeAsync(asyncAction);
}

public static async Task StopAsync()
{
var application = Application.Current;
Expand All @@ -48,4 +50,20 @@ public static async Task StopAsync()

await Dispatcher.UIThread.InvokeAsync(() => appLifetime.Shutdown());
}

private static async Task StartApplicationAsync()
{
var taskComplSource = new TaskCompletionSource();
var uiThread = new Thread(_ =>
{
AppBuilder.Configure<UnitTestApplication>()
.LogToTrace()
.UseHeadless(new AvaloniaHeadlessPlatformOptions())
.AfterSetup(_ => taskComplSource.SetResult())
.StartWithClassicDesktopLifetime(Array.Empty<string>(), ShutdownMode.OnExplicitShutdown);
});
uiThread.Start();

await taskComplSource.Task;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit bd82582

Please sign in to comment.