Skip to content

Commit 765fcba

Browse files
committed
Made tests dotnet build compatible.
1 parent 20ace56 commit 765fcba

File tree

5 files changed

+62
-252
lines changed

5 files changed

+62
-252
lines changed

QRCoderTests/QRCodeRendererTests.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,15 @@ public void can_create_standard_qrcode_graphic()
3333

3434
result.ShouldBe("41d3313c10d84034d67d476eec04163f");
3535
}
36-
#endif
37-
3836

39-
#if !NETCOREAPP1_1 && !NETCOREAPP2_0
4037
[Fact]
4138
[Category("QRRenderer/QRCode")]
4239
public void can_create_qrcode_with_transparent_logo_graphic()
4340
{
4441
//Create QR code
4542
var gen = new QRCodeGenerator();
4643
var data = gen.CreateQrCode("This is a quick test! 123#?", QRCodeGenerator.ECCLevel.H);
47-
var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.Transparent, icon: Resources.noun_software_engineer_2909346);
44+
var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.Transparent, icon: (Bitmap)Bitmap.FromFile(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).Replace("file:\\", "") + "\\assets\\noun_software engineer_2909346.png"));
4845
//Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346
4946

5047
var ms = new MemoryStream();
@@ -65,7 +62,7 @@ public void can_create_qrcode_with_non_transparent_logo_graphic()
6562
//Create QR code
6663
var gen = new QRCodeGenerator();
6764
var data = gen.CreateQrCode("This is a quick test! 123#?", QRCodeGenerator.ECCLevel.H);
68-
var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.White, icon: Resources.noun_software_engineer_2909346);
65+
var bmp = new QRCode(data).GetGraphic(10, Color.Black, Color.White, icon: (Bitmap)Bitmap.FromFile(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).Replace("file:\\", "") + "\\assets\\noun_software engineer_2909346.png"));
6966
//Used logo is licensed under public domain. Ref.: https://thenounproject.com/Iconathon1/collection/redefining-women/?i=2909346
7067

7168
var ms = new MemoryStream();
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>net35;net452;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
4+
<IsPackable>false</IsPackable>
5+
<IsTestProject>true</IsTestProject>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
9+
</ItemGroup>
10+
<ItemGroup Condition=" '$(TargetFramework)' != 'net35' ">
11+
<PackageReference Include="xunit" Version="2.4.1" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
13+
<PackageReference Include="shouldly" Version="3.0.2" />
14+
</ItemGroup>
15+
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
16+
<PackageReference Include="xunit" Version="1.9.2" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="2.0.1" />
18+
<PackageReference Include="shouldly" Version="2.8.3" />
19+
</ItemGroup>
20+
<ItemGroup>
21+
<ProjectReference Include="..\QRCoder\QRCoder.csproj" />
22+
</ItemGroup>
23+
<ItemGroup>
24+
<None Update="assets\noun_software engineer_2909346.png">
25+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
26+
</None>
27+
</ItemGroup>
28+
<PropertyGroup>
29+
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
30+
</PropertyGroup>
31+
</Project>

QRCoderTests/QRCoderTests.csproj

Lines changed: 29 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,31 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFrameworks>net35;net452;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
5-
<IsPackable>false</IsPackable>
6-
<IsTestProject>true</IsTestProject>
7-
</PropertyGroup>
8-
9-
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
11-
</ItemGroup>
12-
13-
<ItemGroup Condition=" '$(TargetFramework)' != 'net35' ">
14-
<PackageReference Include="xunit" Version="2.4.1" />
15-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
16-
<PackageReference Include="shouldly" Version="3.0.2" />
17-
</ItemGroup>
18-
19-
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
20-
<PackageReference Include="xunit" Version="1.9.2" />
21-
<PackageReference Include="xunit.runner.visualstudio" Version="2.0.1" />
22-
<PackageReference Include="shouldly" Version="2.8.3" />
23-
</ItemGroup>
24-
25-
<ItemGroup>
26-
<ProjectReference Include="..\QRCoder\QRCoder.csproj" />
27-
</ItemGroup>
28-
29-
<ItemGroup>
30-
<Compile Update="Resources.Designer.cs">
31-
<DesignTime>True</DesignTime>
32-
<AutoGen>True</AutoGen>
33-
<DependentUpon>Resources.resx</DependentUpon>
34-
</Compile>
35-
</ItemGroup>
36-
37-
<ItemGroup>
38-
<EmbeddedResource Update="Resources.resx">
39-
<Generator>ResXFileCodeGenerator</Generator>
40-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
41-
</EmbeddedResource>
42-
</ItemGroup>
43-
44-
<PropertyGroup>
45-
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
46-
</PropertyGroup>
47-
2+
<PropertyGroup>
3+
<TargetFrameworks>net35;net452;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
4+
<IsPackable>false</IsPackable>
5+
<IsTestProject>true</IsTestProject>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
9+
</ItemGroup>
10+
<ItemGroup Condition=" '$(TargetFramework)' != 'net35' ">
11+
<PackageReference Include="xunit" Version="2.4.1" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
13+
<PackageReference Include="shouldly" Version="3.0.2" />
14+
</ItemGroup>
15+
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
16+
<PackageReference Include="xunit" Version="1.9.2" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="2.0.1" />
18+
<PackageReference Include="shouldly" Version="2.8.3" />
19+
</ItemGroup>
20+
<ItemGroup>
21+
<ProjectReference Include="..\QRCoder\QRCoder.csproj" />
22+
</ItemGroup>
23+
<ItemGroup>
24+
<None Update="assets\noun_software engineer_2909346.png">
25+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
26+
</None>
27+
</ItemGroup>
28+
<PropertyGroup>
29+
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
30+
</PropertyGroup>
4831
</Project>

QRCoderTests/Resources.Designer.cs

Lines changed: 0 additions & 77 deletions
This file was deleted.

QRCoderTests/Resources.resx

Lines changed: 0 additions & 124 deletions
This file was deleted.

0 commit comments

Comments
 (0)