更新客户端渲染,更新了壳
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
using Wpf.Ui.Animations;
|
||||
|
||||
namespace Wpf.Ui.UnitTests.Animations;
|
||||
|
||||
public class TransitionAnimationProviderTests
|
||||
{
|
||||
[Fact]
|
||||
public void ApplyTransition_ReturnsFalse_WhenDurationIsLessThan10()
|
||||
{
|
||||
UIElement mockedUiElement = Substitute.For<UIElement>();
|
||||
|
||||
var result = TransitionAnimationProvider.ApplyTransition(mockedUiElement, Transition.FadeIn, -10);
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ApplyTransition_ReturnsFalse_WhenElementIsNull()
|
||||
{
|
||||
var result = TransitionAnimationProvider.ApplyTransition(null, Transition.FadeIn, 1000);
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
using Wpf.Ui.Controls;
|
||||
using Wpf.Ui.Extensions;
|
||||
|
||||
namespace Wpf.Ui.UnitTests.Extensions;
|
||||
|
||||
public class SymbolExtensionsTests
|
||||
{
|
||||
[Fact]
|
||||
public void GivenAllRegularSymbols_Swap_ReturnsValidFilledSymbol()
|
||||
{
|
||||
foreach (SymbolRegular regularSymbol in Enum.GetValues(typeof(SymbolRegular)))
|
||||
{
|
||||
_ = regularSymbol.Swap();
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GivenAllFilledSymbols_Swap_ReturnsValidRegularSymbol()
|
||||
{
|
||||
foreach (SymbolFilled filledSymbol in Enum.GetValues(typeof(SymbolFilled)))
|
||||
{
|
||||
_ = filledSymbol.Swap();
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GivenAllRegularSymbols_GetString_ReturnsValidString()
|
||||
{
|
||||
foreach (SymbolRegular regularSymbol in Enum.GetValues(typeof(SymbolRegular)))
|
||||
{
|
||||
if (regularSymbol == SymbolRegular.Empty)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var receivedString = regularSymbol.GetString();
|
||||
|
||||
Assert.NotEqual(string.Empty, receivedString);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GivenAllFilledSymbols_GetString_ReturnsValidString()
|
||||
{
|
||||
foreach (SymbolFilled filledSymbol in Enum.GetValues(typeof(SymbolFilled)))
|
||||
{
|
||||
if (filledSymbol == SymbolFilled.Empty)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var receivedString = filledSymbol.GetString();
|
||||
|
||||
Assert.NotEqual(string.Empty, receivedString);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
global using System;
|
||||
global using System.Windows;
|
||||
global using NSubstitute;
|
||||
global using Xunit;
|
||||
@@ -0,0 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<OutputType>Exe</OutputType>
|
||||
<IsPackable>false</IsPackable>
|
||||
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
|
||||
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AwesomeAssertions" />
|
||||
<PackageReference Include="NSubstitute" />
|
||||
<PackageReference Include="xunit.v3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Wpf.Ui\Wpf.Ui.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="AwesomeAssertions" />
|
||||
<Using Include="NSubstitute" />
|
||||
<Using Include="Xunit" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
|
||||
"culture": "invariant",
|
||||
"parallelizeTestCollections": false,
|
||||
"diagnosticMessages": true
|
||||
}
|
||||
Reference in New Issue
Block a user