Skip to content

Commit

Permalink
Disabled ImplicitUsing for Avalonia test project clarity, adding `usi…
Browse files Browse the repository at this point in the history
…ng` statments to each class
  • Loading branch information
DamianSuess committed Aug 31, 2024
1 parent d4b2a05 commit d976f0d
Show file tree
Hide file tree
Showing 32 changed files with 85 additions and 32 deletions.
11 changes: 7 additions & 4 deletions PrismLibrary.sln
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Prism.DryIoc.Avalonia.Tests
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Prism.IocContainer.Avalonia.Tests.Support", "tests\Avalonia\Prism.IocContainer.Avalonia.Tests.Support\Prism.IocContainer.Avalonia.Tests.Support.csproj", "{887E0794-798D-4127-847E-6F68D5C9B334}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Avalonia", "Avalonia", "{904D5094-55F9-4581-90AC-D6C1131F8152}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -402,10 +404,11 @@ Global
{8AE1015F-4D62-47EF-A576-2F7411EC20D5} = {F3664D7A-6FF5-4D1F-9F5F-26EE87F032D3}
{C505C63F-99E6-464F-8C83-1AE4239C19B1} = {8AE1015F-4D62-47EF-A576-2F7411EC20D5}
{A6B7B19C-3288-4CD2-A737-527BEB1ED807} = {8AE1015F-4D62-47EF-A576-2F7411EC20D5}
{AB501F63-8E8C-4333-8A15-81BA02F3C703} = {00FFDC13-7397-46F1-897E-A62A7575D28A}
{6FDA7D49-DF44-4E8F-A182-0EB73DD3C452} = {00FFDC13-7397-46F1-897E-A62A7575D28A}
{03B9C775-9582-409F-B67F-6B8A0CE0C7AF} = {00FFDC13-7397-46F1-897E-A62A7575D28A}
{887E0794-798D-4127-847E-6F68D5C9B334} = {00FFDC13-7397-46F1-897E-A62A7575D28A}
{AB501F63-8E8C-4333-8A15-81BA02F3C703} = {904D5094-55F9-4581-90AC-D6C1131F8152}
{6FDA7D49-DF44-4E8F-A182-0EB73DD3C452} = {904D5094-55F9-4581-90AC-D6C1131F8152}
{03B9C775-9582-409F-B67F-6B8A0CE0C7AF} = {904D5094-55F9-4581-90AC-D6C1131F8152}
{887E0794-798D-4127-847E-6F68D5C9B334} = {904D5094-55F9-4581-90AC-D6C1131F8152}
{904D5094-55F9-4581-90AC-D6C1131F8152} = {00FFDC13-7397-46F1-897E-A62A7575D28A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C7433AE2-B1A0-4C1A-887E-5CAA7AAF67A6}
Expand Down
5 changes: 3 additions & 2 deletions src/Avalonia/Prism.Avalonia/Prism.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Prism.Avalonia helps you more easily design and build rich, flexible, and easy t
<Reference Include="System.Configuration" />
</ItemGroup>

<!--<ItemGroup Condition=" $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' ">-->
<ItemGroup Condition=" $(TargetFramework.StartsWith('netcore')) OR $(TargetFramework.StartsWith('net6')) OR $(TargetFramework.StartsWith('net7')) OR $(TargetFramework.StartsWith('net8'))">
<Compile Remove="**\*.net45.cs" />
<None Include="**\*.net45.cs" />
Expand All @@ -31,11 +30,13 @@ Prism.Avalonia helps you more easily design and build rich, flexible, and easy t
<Using Include="Prism.Extensions" />
</ItemGroup>

<!--
<ItemGroup>
<!-- We probably don't want to support this in Avalonia projects keeping for now -->
< ! - - We probably don't want to support this in Avalonia projects keeping for now - - >
<Compile Remove="PrismBootstrapperBase.cs" />
<None Include="PrismBootstrapperBase.cs" />
</ItemGroup>
-->

<ItemGroup>
<Reference Include="PresentationFramework" />
Expand Down
2 changes: 2 additions & 0 deletions tests/Avalonia/Prism.Avalonia.Tests/ListDictionaryFixture.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;
using System.Collections.Generic;
using Prism.Common;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Prism.Ioc;
using Prism.Modularity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Prism.Ioc;
using Prism.Modularity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Prism.Ioc;
using Prism.Modularity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Prism.Ioc;
using Prism.Modularity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Prism.Ioc;
using Prism.Modularity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Prism.Ioc;
using Prism.Modularity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Prism.Ioc;
using Prism.Modularity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Avalonia.Controls;
using Avalonia.Controls;
using Prism.Mvvm;

namespace Prism.Avalonia.Tests.Mocks.Views
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using Prism.Modularity;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Configuration;
using System.Linq;
using Prism.Avalonia.Tests.Mocks;
using Prism.Modularity;
using Xunit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Prism.Modularity;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;
using System.Linq;
using Prism.Ioc;
using Prism.Modularity;
using Xunit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Reflection;
using Prism.Mvvm;
using Prism.Avalonia.Tests.Mocks.ViewModels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<ProjectReference Include="..\..\..\src\Avalonia\Prism.Avalonia\Prism.Avalonia.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\..\src\Wpf\Prism.Wpf\Mvvm\*.cs" LinkBase="Mvvm" />
<Using Include="Prism.Extensions" />
</ItemGroup>

<ItemGroup>
<None Update="Modularity\ModuleCatalogXaml\InvalidDependencyModuleCatalog.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Xunit;
using System;
using Prism.Navigation.Regions;
using Xunit;

namespace Prism.Avalonia.Tests.Regions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Prism.Avalonia.Tests.Mocks;
using Prism.Avalonia.Tests.Mocks;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Behaviors;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Prism.Navigation.Regions;
using Prism.Avalonia.Tests.Mocks;
using Prism.Navigation.Regions.Behaviors;
using Xunit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Avalonia;
using System;
using System.Linq;
using Avalonia;
using Prism.Avalonia.Tests.Mocks;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Behaviors;
using Xunit;

Expand Down Expand Up @@ -36,8 +39,8 @@ public void RegionWillNotGetCreatedTwiceWhenThereAreMoreRegions()
var adapter = new MockRegionAdapter();
adapter.Accessor = accessor;

var behavior1 = this.GetBehavior(control1, accessor, adapter);
var behavior2 = this.GetBehavior(control2, accessor, adapter);
var behavior1 = GetBehavior(control1, accessor, adapter);
var behavior2 = GetBehavior(control2, accessor, adapter);

behavior1.Attach();
behavior2.Attach();
Expand All @@ -60,9 +63,9 @@ public void RegionGetsCreatedWhenAccessingRegions()
GetRegionName = d => "myRegionName"
};

var behavior1 = this.GetBehavior(control1, accessor);
var behavior1 = GetBehavior(control1, accessor);
behavior1.Attach();
var behavior2 = this.GetBehavior(control2, accessor);
var behavior2 = GetBehavior(control2, accessor);
behavior2.Attach();

accessor.UpdateRegions();
Expand All @@ -83,7 +86,7 @@ public void RegionDoesNotGetCreatedTwiceWhenUpdatingRegions()
GetRegionName = d => "myRegionName"
};

var behavior = this.GetBehavior(control, accessor);
var behavior = GetBehavior(control, accessor);
behavior.Attach();
accessor.UpdateRegions();
IRegion region = RegionManager.GetObservableRegion(control).Value;
Expand All @@ -104,7 +107,7 @@ public void BehaviorDoesNotPreventControlFromBeingGarbageCollected()
GetRegionName = d => "myRegionName"
};

var behavior = this.GetBehavior(control, accessor);
var behavior = GetBehavior(control, accessor);
behavior.Attach();

Assert.True(controlWeakReference.IsAlive);
Expand All @@ -127,7 +130,7 @@ public void BehaviorDoesNotPreventControlFromBeingGarbageCollectedWhenRegionWasC
GetRegionName = d => "myRegionName"
};

var behavior = this.GetBehavior(control, accessor);
var behavior = GetBehavior(control, accessor);
behavior.Attach();
accessor.UpdateRegions();

Expand All @@ -149,7 +152,7 @@ public void BehaviorShouldUnhookEventWhenDetaching()
{
GetRegionName = d => "myRegionName",
};
var behavior = this.GetBehavior(control, accessor);
var behavior = GetBehavior(control, accessor);
behavior.Attach();

int startingCount = accessor.GetSubscribersCount();
Expand All @@ -170,7 +173,7 @@ public void ShouldCleanupBehaviorOnceRegionIsCreated()
GetRegionName = d => "myRegionName"
};

var behavior = this.GetBehavior(control, accessor);
var behavior = GetBehavior(control, accessor);
WeakReference behaviorWeakReference = new WeakReference(behavior);
behavior.Attach();
accessor.UpdateRegions();
Expand All @@ -182,7 +185,7 @@ public void ShouldCleanupBehaviorOnceRegionIsCreated()

Assert.False(behaviorWeakReference.IsAlive);

var behavior2 = this.GetBehavior(control2, accessor);
var behavior2 = GetBehavior(control2, accessor);
WeakReference behaviorWeakReference2 = new WeakReference(behavior2);
behavior2.Attach();
accessor.UpdateRegions();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Avalonia;
using System;
using Avalonia;
using Prism.Avalonia.Tests.Mocks;
using Prism.Common;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Behaviors;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Moq;
using System;
using Moq;
using Prism.Navigation;
using Prism.Navigation.Regions;
using Xunit;

namespace Prism.Avalonia.Tests.Regions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Moq;
using System;
using Moq;
using Prism.Navigation.Regions;
using Xunit;

namespace Prism.Avalonia.Tests.Regions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Prism.Navigation.Regions;
using Prism.Navigation.Regions;
using Prism.Avalonia.Tests.Mocks;
using Avalonia.Controls;
using Moq;
using Prism.Ioc;
using Xunit;
using System;
using System.Collections.Generic;

namespace Prism.Avalonia.Tests.Regions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Prism.Avalonia.Tests.Mocks;
using Prism.Navigation.Regions;
using Xunit;

namespace Prism.Avalonia.Tests.Regions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
using Moq;
using Prism.Ioc;
using Xunit;
using Prism.Navigation.Regions;
using System.Linq;
using System;

namespace Prism.Avalonia.Tests.Regions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Moq;
using System;
using Moq;
using Prism.Navigation;
using Prism.Navigation.Regions;
using Xunit;

namespace Prism.Avalonia.Tests.Regions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using Avalonia.Controls;
using Moq;
using Prism.Ioc;
using Prism.Navigation;
using Prism.Navigation.Regions;
using Xunit;
namespace Prism.Avalonia.Tests.Regions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void OnRegisterErrorShouldSkipFrameworkExceptions()
Assert.Contains("R1", ex.Message);
}

[StaFact]
[StaFact(DisplayName = "Flaky test, runs alone but not in a group")]
public void RegisterViewWithRegion_ShouldHaveViewModel_ByDefault()
{
ViewModelLocatorFixture.ResetViewModelLocationProvider();
Expand All @@ -139,7 +139,7 @@ public void RegisterViewWithRegion_ShouldHaveViewModel_ByDefault()
Assert.IsType<Mocks.ViewModels.MockViewModel>(view.DataContext);
}

[StaFact]
[StaFact(DisplayName = "Flaky test, runs alone but not in a group")]
public void RegisterViewWithRegion_ShouldNotHaveViewModel_OnOptOut()
{
ViewModelLocatorFixture.ResetViewModelLocationProvider();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Moq;
using Moq;
using Prism.Ioc;
using Prism.Navigation.Regions;
using Xunit;

namespace Prism.Avalonia.Tests.Regions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// NOTE:
// NOTE:
// Avalonia.Data.CollectionViewSource control does not exist in Avalonia.
// This feature was apart of a legacy build:
// https://github.com/grokys/Avalonia/blob/master/Avalonia/Data/CollectionViewSource.cs
Expand All @@ -7,7 +7,9 @@
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using Prism.Avalonia.Tests.Mocks;
using Prism.Navigation.Regions;
using Xunit;

namespace Prism.Avalonia.Tests.Regions
Expand Down

0 comments on commit d976f0d

Please sign in to comment.