Skip to content

Commit

Permalink
Move tests into a shared folder (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow authored Jun 28, 2022
1 parent b4b9752 commit fe4c7bc
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<DefineConstants>$(DefineConstants);XAMARIN_FORMS</DefineConstants>
</PropertyGroup>

<ItemGroup>
Expand All @@ -17,6 +18,26 @@
<ProjectReference Include="..\..\source\SkiaSharp.Extended.UI.Forms\SkiaSharp.Extended.UI.Forms.csproj" />
</ItemGroup>

<ItemGroup>
<Using Include="System" />
<Using Include="System.Collections.Generic" />
<Using Include="System.IO" />
<Using Include="System.Net.Http" />
<Using Include="System.Threading" />
<Using Include="System.Threading.Tasks" />
<Using Include="Xamarin.Forms" />
<Using Include="Xamarin.Forms.Internals" />
<Using Include="Xamarin.Forms.Xaml" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\SkiaSharp.Extended.UI.Tests\**\*.cs" />
</ItemGroup>

<ItemGroup>
<Content Include="..\SkiaSharp.Extended.UI.Tests\TestAssets\**" Link="TestAssets\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup>
<None Remove="TestResults\**\*" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWpf>true</UseWpf>
<DefineConstants>$(DefineConstants);XAMARIN_FORMS</DefineConstants>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using SkiaSharp.Extended.UI.Controls.Converters;
using Xamarin.Forms;
using Xunit;

#if XAMARIN_FORMS
using Colors = Xamarin.Forms.Color;
#endif

namespace SkiaSharp.Extended.UI.Controls.Tests
{
public class SKConfettiColorCollectionTypeConverterTest
Expand All @@ -22,7 +25,7 @@ public void CanParseSingleColor(string value)

Assert.NotNull(collection);
var color = Assert.Single(collection);
Assert.Equal(Color.Red, color);
Assert.Equal(Colors.Red, color);
}

[Theory]
Expand All @@ -40,7 +43,7 @@ public void CanParseMultipleColors(string value)
var collection = Assert.IsType<SKConfettiColorCollection>(result);

Assert.NotNull(collection);
Assert.Equal(new[] { Color.Red, Color.Red, Color.Blue }, collection);
Assert.Equal(new[] { Colors.Red, Colors.Red, Colors.Blue }, collection);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using SkiaSharp.Extended.UI.Controls.Converters;
using Xamarin.Forms;
using Xunit;

namespace SkiaSharp.Extended.UI.Controls.Tests
Expand Down

0 comments on commit fe4c7bc

Please sign in to comment.