Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: test netcore31 and net50 #23

Merged
merged 1 commit into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions SkiaSharp.QrCode.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NanoServerGenerate.3.1", "s
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D411A8A1-96FC-495F-9583-4C154DF25240}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkiaSharp.QrCodeUnitTest", "tests\SkiaSharp.QrCodeUnitTest\SkiaSharp.QrCodeUnitTest.csproj", "{DECFF371-3592-4855-A465-1845DEF972A1}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AF981C34-65A3-48DB-BBFB-52EFE0F824AB}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharp.QrCode.Tests.net50", "tests\SkiaSharp.QrCode.Tests.net50\SkiaSharp.QrCode.Tests.net50.csproj", "{975C9157-6E43-44DE-9405-C2CF8C217AE6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharp.QrCode.Tests.net31", "tests\SkiaSharp.QrCode.Tests.net31\SkiaSharp.QrCode.Tests.net31.csproj", "{4960D7EB-2B2B-4B27-ADA1-923AB06DBC72}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -47,10 +54,14 @@ Global
{2FCFFF3C-FBA0-42A2-942C-8CB6E5835CE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FCFFF3C-FBA0-42A2-942C-8CB6E5835CE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FCFFF3C-FBA0-42A2-942C-8CB6E5835CE3}.Release|Any CPU.Build.0 = Release|Any CPU
{DECFF371-3592-4855-A465-1845DEF972A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DECFF371-3592-4855-A465-1845DEF972A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DECFF371-3592-4855-A465-1845DEF972A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DECFF371-3592-4855-A465-1845DEF972A1}.Release|Any CPU.Build.0 = Release|Any CPU
{975C9157-6E43-44DE-9405-C2CF8C217AE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{975C9157-6E43-44DE-9405-C2CF8C217AE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{975C9157-6E43-44DE-9405-C2CF8C217AE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{975C9157-6E43-44DE-9405-C2CF8C217AE6}.Release|Any CPU.Build.0 = Release|Any CPU
{4960D7EB-2B2B-4B27-ADA1-923AB06DBC72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4960D7EB-2B2B-4B27-ADA1-923AB06DBC72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4960D7EB-2B2B-4B27-ADA1-923AB06DBC72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4960D7EB-2B2B-4B27-ADA1-923AB06DBC72}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -61,7 +72,8 @@ Global
{096520D5-85EC-4AC5-BDE4-7F11B5874EDA} = {C4DBE18B-7128-4E6E-B5C6-F18E4DA5D616}
{BB6B4CE2-A9AA-4CBA-A0EA-CA9EEC6024D9} = {C4DBE18B-7128-4E6E-B5C6-F18E4DA5D616}
{2FCFFF3C-FBA0-42A2-942C-8CB6E5835CE3} = {C4DBE18B-7128-4E6E-B5C6-F18E4DA5D616}
{DECFF371-3592-4855-A465-1845DEF972A1} = {D411A8A1-96FC-495F-9583-4C154DF25240}
{975C9157-6E43-44DE-9405-C2CF8C217AE6} = {D411A8A1-96FC-495F-9583-4C154DF25240}
{4960D7EB-2B2B-4B27-ADA1-923AB06DBC72} = {D411A8A1-96FC-495F-9583-4C154DF25240}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D0A3AD8D-B614-4A6D-AB7E-6A6993495E0F}
Expand Down
17 changes: 0 additions & 17 deletions sample/ManualGenerate/ManualGenerate - Backup.csproj

This file was deleted.

12 changes: 0 additions & 12 deletions sample/SimpleGenerate/SimpleGenerate - Backup.csproj

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@
using System.Threading.Tasks;
using Xunit;

namespace SkiaSharp.QrCodeUnitTest
namespace SkiaSharp.QrCode.Tests.Shared
{
public class GenerateUnitTest
{
private readonly string content = "testtesttest";
#if NET5_0
private readonly string netcore = "net5.0";
#else
private readonly string netcore = "net3.1";
#endif

[Fact]
public void SimpleGenerateUnitTest()
{
var actual = GenerateQrCode(content, null);
var expect = File.ReadAllBytes("samples/net3.1/testtesttest_white.png");
var expect = File.ReadAllBytes($"samples/{netcore}/testtesttest_white.png");
Assert.True(actual.SequenceEqual(expect));
}

Expand All @@ -30,7 +35,7 @@ public void ColorGenerateUnitTest()
})
{
var actual = GenerateQrCode(content, item.color);
var expect = File.ReadAllBytes($"samples/net3.1/testtesttest_{item.name}.png");
var expect = File.ReadAllBytes($"samples/{netcore}/testtesttest_{item.name}.png");
Assert.True(actual.SequenceEqual(expect));
}
}
Expand All @@ -46,7 +51,7 @@ public void IconGenerateUnitTest()
IconSizePercent = 10,
};
var actual = GenerateQrCode(content, SKColor.Parse("000000"), icon);
var expect = File.ReadAllBytes($"samples/net3.1/testtesttest_icon.png");
var expect = File.ReadAllBytes($"samples/{netcore}/testtesttest_icon.png");
Assert.True(actual.SequenceEqual(expect));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<LangVersion>9.0</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -17,6 +17,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="2.7.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>SkiaSharp.QrCode.Tests._50</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\SkiaSharp.QrCode.Tests.net31\GenerateUnitTest.cs" Link="GenerateUnitTest.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="2.7.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\SkiaSharp.QrCode\SkiaSharp.QrCode.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="samples\**\*.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.