Skip to content

Commit db6788f

Browse files
committed
Added coverlet.tests.projectsample.wpf6.tests
1 parent d9b9431 commit db6788f

File tree

9 files changed

+107
-1
lines changed

9 files changed

+107
-1
lines changed

coverlet.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.tests.projectsampl
6464
EndProject
6565
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.tests.projectsample.aspnet6.tests", "test\coverlet.tests.projectsample.aspnet6.tests\coverlet.tests.projectsample.aspnet6.tests.csproj", "{8EC065A4-7700-45E6-8B90-0182E3649DEA}"
6666
EndProject
67+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.tests.projectsample.wpf6", "test\coverlet.tests.projectsample.wpf6\coverlet.tests.projectsample.wpf6.csproj", "{988A5FF0-4326-4F5B-9F05-CB165543A555}"
68+
EndProject
69+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.tests.projectsample.wpf6.tests", "test\coverlet.tests.projectsample.wpf6.tests\coverlet.tests.projectsample.wpf6.tests.csproj", "{44C7F807-F754-401D-B608-3697843A45E9}"
70+
EndProject
6771
Global
6872
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6973
Debug|Any CPU = Debug|Any CPU
@@ -146,6 +150,14 @@ Global
146150
{8EC065A4-7700-45E6-8B90-0182E3649DEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
147151
{8EC065A4-7700-45E6-8B90-0182E3649DEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
148152
{8EC065A4-7700-45E6-8B90-0182E3649DEA}.Release|Any CPU.Build.0 = Release|Any CPU
153+
{988A5FF0-4326-4F5B-9F05-CB165543A555}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
154+
{988A5FF0-4326-4F5B-9F05-CB165543A555}.Debug|Any CPU.Build.0 = Debug|Any CPU
155+
{988A5FF0-4326-4F5B-9F05-CB165543A555}.Release|Any CPU.ActiveCfg = Release|Any CPU
156+
{988A5FF0-4326-4F5B-9F05-CB165543A555}.Release|Any CPU.Build.0 = Release|Any CPU
157+
{44C7F807-F754-401D-B608-3697843A45E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
158+
{44C7F807-F754-401D-B608-3697843A45E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
159+
{44C7F807-F754-401D-B608-3697843A45E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
160+
{44C7F807-F754-401D-B608-3697843A45E9}.Release|Any CPU.Build.0 = Release|Any CPU
149161
EndGlobalSection
150162
GlobalSection(SolutionProperties) = preSolution
151163
HideSolutionNode = FALSE
@@ -171,6 +183,8 @@ Global
171183
{C9B7DC34-3E04-4F20-AED4-73791AF8020D} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
172184
{1C3CA3F8-DF8C-433F-8A56-69102D2BBDF6} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
173185
{8EC065A4-7700-45E6-8B90-0182E3649DEA} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
186+
{988A5FF0-4326-4F5B-9F05-CB165543A555} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
187+
{44C7F807-F754-401D-B608-3697843A45E9} = {2FEBDE1B-83E3-445B-B9F8-5644B0E0E134}
174188
EndGlobalSection
175189
GlobalSection(ExtensibilityGlobals) = postSolution
176190
SolutionGuid = {9CA57C02-97B0-4C38-A027-EA61E8741F10}

src/coverlet.core/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
[assembly: InternalsVisibleTo("coverlet.collector.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed0ed6af9693182615b8dcadc83c918b8d36312f86cefc69539d67d4189cd1b89420e7c3871802ffef7f5ca7816c68ad856c77bf7c230cc07824d96aa5d1237eebd30e246b9a14e22695fb26b40c800f74ea96619092cbd3a5d430d6c003fc7a82e8ccd1e315b935105d9232fe9e99e8d7ff54bba6f191959338d4a3169df9b3")]
1515
[assembly: InternalsVisibleTo("coverlet.integration.tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010001d24efbe9cbc2dc49b7a3d2ae34ca37cfb69b4f450acd768a22ce5cd021c8a38ae7dc68b2809a1ac606ad531b578f192a5690b2986990cbda4dd84ec65a3a4c1c36f6d7bb18f08592b93091535eaee2f0c8e48763ed7f190db2008e1f9e0facd5c0df5aaab74febd3430e09a428a72e5e6b88357f92d78e47512d46ebdc3cbb")]
1616
[assembly: InternalsVisibleTo("coverlet.tests.projectsample.aspnet6.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100757cf9291d78a82e5bb58a827a3c46c2f959318327ad30d1b52e918321ffbd847fb21565b8576d2a3a24562a93e86c77a298b564a0f1b98f63d7a1441a3a8bcc206da3ed09d5dacc76e122a109a9d3ac608e21a054d667a2bae98510a1f0f653c0e6f58f42b4b3934f6012f5ec4a09b3dfd3e14d437ede1424bdb722aead64ad")]
17+
[assembly: InternalsVisibleTo("coverlet.tests.projectsample.wpf6.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100757cf9291d78a82e5bb58a827a3c46c2f959318327ad30d1b52e918321ffbd847fb21565b8576d2a3a24562a93e86c77a298b564a0f1b98f63d7a1441a3a8bcc206da3ed09d5dacc76e122a109a9d3ac608e21a054d667a2bae98510a1f0f653c0e6f58f42b4b3934f6012f5ec4a09b3dfd3e14d437ede1424bdb722aead64ad")]
1718

1819
// Needed to mock internal type https://github.com/Moq/moq4/wiki/Quickstart#advanced-features
1920
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]

test/coverlet.tests.projectsample.aspnet6.tests/ResolverTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public void TestInstrument_NetCoreSharedFrameworkResolver()
3030
true);
3131

3232
var assemblies = new List<string>();
33-
Assert.True(resolver.TryResolveAssemblyPaths(compilationLibrary, assemblies));
33+
Assert.True(resolver.TryResolveAssemblyPaths(compilationLibrary, assemblies),
34+
"sample assembly shall be resolved");
3435
Assert.NotEmpty(assemblies);
3536
}
3637
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) Toni Solarin-Sodara
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.Reflection;
5+
6+
[assembly: AssemblyKeyFile("coverlet.tests.projectsample.wpf6.tests.snk")]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (c) Toni Solarin-Sodara
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Reflection;
7+
using Coverlet.Core.Abstractions;
8+
using Coverlet.Core.Instrumentation;
9+
using Coverlet.Tests.Xunit.Extensions;
10+
using Microsoft.Extensions.DependencyModel;
11+
using Moq;
12+
using Xunit;
13+
14+
namespace coverlet.tests.projectsample.wpf6.tests
15+
{
16+
public class ResolverTests
17+
{
18+
[ConditionalFact]
19+
[SkipOnOS(OS.Linux)]
20+
[SkipOnOS(OS.MacOS)]
21+
public void TestInstrument_NetCoreSharedFrameworkResolver()
22+
{
23+
Assembly assembly = GetType().Assembly;
24+
var mockLogger = new Mock<ILogger>();
25+
var resolver = new NetCoreSharedFrameworkResolver(assembly.Location, mockLogger.Object);
26+
var compilationLibrary = new CompilationLibrary(
27+
"package",
28+
"System.Drawing",
29+
"0.0.0.0",
30+
"sha512-not-relevant",
31+
Enumerable.Empty<string>(),
32+
Enumerable.Empty<Dependency>(),
33+
true);
34+
35+
var assemblies = new List<string>();
36+
Assert.True(resolver.TryResolveAssemblyPaths(compilationLibrary, assemblies),
37+
"sample assembly shall be resolved");
38+
Assert.NotEmpty(assemblies);
39+
}
40+
}
41+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0-windows</TargetFramework>
5+
<IsPackable>false</IsPackable>
6+
<EnableWindowsTargeting>true</EnableWindowsTargeting>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
11+
<PackageReference Include="Moq" />
12+
<PackageReference Include="xunit" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\..\src\coverlet.core\coverlet.core.csproj" />
17+
<ProjectReference Include="..\coverlet.tests.projectsample.wpf6\coverlet.tests.projectsample.wpf6.csproj" />
18+
<ProjectReference Include="..\coverlet.tests.xunit.extensions\coverlet.tests.xunit.extensions.csproj" />
19+
</ItemGroup>
20+
21+
</Project>
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) Toni Solarin-Sodara
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.Windows.Controls;
5+
6+
namespace coverlet.tests.projectsample.wpf6
7+
{
8+
public class TestClass
9+
{
10+
public UserControl Control { get; set; }
11+
}
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0-windows</TargetFramework>
5+
<UseWpf>true</UseWpf>
6+
<IsTestProject>false</IsTestProject>
7+
<EnableWindowsTargeting>true</EnableWindowsTargeting>
8+
</PropertyGroup>
9+
10+
</Project>

0 commit comments

Comments
 (0)