Skip to content

Commit 67359d6

Browse files
committed
Added coverlet.tests.projectsample.wpf5.tests
1 parent 052932f commit 67359d6

File tree

9 files changed

+101
-1
lines changed

9 files changed

+101
-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.aspnet5.tests", "test\coverlet.tests.projectsample.aspnet5.tests\coverlet.tests.projectsample.aspnet5.tests.csproj", "{8EC065A4-7700-45E6-8B90-0182E3649DEA}"
6666
EndProject
67+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.tests.projectsample.wpf5", "test\coverlet.tests.projectsample.wpf5\coverlet.tests.projectsample.wpf5.csproj", "{988A5FF0-4326-4F5B-9F05-CB165543A555}"
68+
EndProject
69+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.tests.projectsample.wpf5.tests", "test\coverlet.tests.projectsample.wpf5.tests\coverlet.tests.projectsample.wpf5.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.aspnet5.tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100757cf9291d78a82e5bb58a827a3c46c2f959318327ad30d1b52e918321ffbd847fb21565b8576d2a3a24562a93e86c77a298b564a0f1b98f63d7a1441a3a8bcc206da3ed09d5dacc76e122a109a9d3ac608e21a054d667a2bae98510a1f0f653c0e6f58f42b4b3934f6012f5ec4a09b3dfd3e14d437ede1424bdb722aead64ad")]
17+
[assembly: InternalsVisibleTo("coverlet.tests.projectsample.wpf5.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.aspnet5.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.wpf5.tests.snk")]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 Microsoft.Extensions.DependencyModel;
10+
using Moq;
11+
using Xunit;
12+
13+
namespace coverlet.tests.projectsample.wpf5.tests
14+
{
15+
public class ResolverTests
16+
{
17+
[Fact]
18+
public void TestInstrument_NetCoreSharedFrameworkResolver()
19+
{
20+
Assembly assembly = GetType().Assembly;
21+
var mockLogger = new Mock<ILogger>();
22+
var resolver = new NetCoreSharedFrameworkResolver(assembly.Location, mockLogger.Object);
23+
var compilationLibrary = new CompilationLibrary(
24+
"package",
25+
"System.Drawing",
26+
"5.0.17.0",
27+
"sha512-B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==",
28+
Enumerable.Empty<string>(),
29+
Enumerable.Empty<Dependency>(),
30+
true);
31+
32+
var assemblies = new List<string>();
33+
Assert.True(resolver.TryResolveAssemblyPaths(compilationLibrary, assemblies),
34+
"sample assembly shall be resolved");
35+
Assert.NotEmpty(assemblies);
36+
}
37+
}
38+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0-windows</TargetFramework>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
10+
<PackageReference Include="Moq" />
11+
<PackageReference Include="xunit" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\..\src\coverlet.core\coverlet.core.csproj" />
16+
<ProjectReference Include="..\coverlet.tests.projectsample.wpf5\coverlet.tests.projectsample.wpf5.csproj" />
17+
</ItemGroup>
18+
19+
</Project>
596 Bytes
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.wpf5
7+
{
8+
public class TestClass
9+
{
10+
public UserControl Control { get; set; }
11+
}
12+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0-windows</TargetFramework>
5+
<UseWpf>true</UseWpf>
6+
<IsTestProject>false</IsTestProject>
7+
</PropertyGroup>
8+
9+
</Project>

0 commit comments

Comments
 (0)