-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't enable transitive references in tests (#10103)
Most of the projects include references to ref and cycle breaker projects. This breaks tests as they will pick the wrong assemblies. Create a stub PresentationFramework.Fluent.Tests project to validate.
- Loading branch information
1 parent
af32a51
commit 722025a
Showing
8 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
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
6 changes: 6 additions & 0 deletions
6
src/Microsoft.DotNet.Wpf/src/PresentationFramework/LibraryAssemblyInfo.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("PresentationFramework.Fluent.Tests, PublicKey=00000000000000000400000000000000")] |
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
1 change: 0 additions & 1 deletion
1
src/Microsoft.DotNet.Wpf/src/WindowsBase/LibraryAssemblyInfo.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("WindowsBase.Tests, PublicKey=00000000000000000400000000000000")] |
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
7 changes: 7 additions & 0 deletions
7
src/Microsoft.DotNet.Wpf/tests/UnitTests/PresentationFramework.Fluent.Tests/GlobalUsings.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
global using Xunit; | ||
#pragma warning disable IDE0005 // Using directive is unnecessary. New project, this will be used. | ||
global using FluentAssertions; | ||
#pragma warning restore IDE0005 |
35 changes: 35 additions & 0 deletions
35
...ts/UnitTests/PresentationFramework.Fluent.Tests/PresentationFramework.Fluent.Tests.csproj
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<Nullable>enable</Nullable> | ||
<Platforms>x64;x86;arm64</Platforms> | ||
<RootNamespace /> | ||
<TargetFramework Condition="!$(TargetFramework.Contains('windows'))">$(TargetFramework)-windows</TargetFramework> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" /> | ||
<PackageReference Include="xunit.stafact" Version="$(XUnitStaFactPackageVersion)" /> | ||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerPackageVersion)" /> | ||
<PackageReference Include="$(SystemIOPackagingPackage)" Version="$(SystemIOPackagingVersion)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<MicrosoftPrivateWinFormsReference Include="System.Private.Windows.Core" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(WpfSourceDir)PresentationFramework\PresentationFramework.csproj" /> | ||
<ProjectReference Include="$(WpfSourceDir)System.Windows.Primitives\System.Windows.Primitives.csproj" /> | ||
|
||
<ProjectReference Include="$(WpfSourceDir)PresentationCore\PresentationCore.csproj" /> | ||
<ProjectReference Include="$(WpfSourceDir)DirectWriteForwarder\DirectWriteForwarder.vcxproj"> | ||
<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties> | ||
</ProjectReference> | ||
<ProjectReference Include="$(WpfSourceDir)System.Xaml\System.Xaml.csproj" /> | ||
<ProjectReference Include="$(WpfSourceDir)WindowsBase\WindowsBase.csproj" /> | ||
<ProjectReference Include="$(WpfSourceDir)UIAutomation\UIAutomationTypes\UIAutomationTypes.csproj" /> | ||
<ProjectReference Include="$(WpfSourceDir)UIAutomation\UIAutomationProvider\UIAutomationProvider.csproj" /> | ||
</ItemGroup> | ||
</Project> |
13 changes: 13 additions & 0 deletions
13
...tests/UnitTests/PresentationFramework.Fluent.Tests/System/Windows/Controls/ButtonTests.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Windows.Controls; | ||
|
||
public class ButtonTests | ||
{ | ||
[WpfFact] | ||
public void Button_Create() | ||
{ | ||
Button button = new(); | ||
} | ||
} |