Move WebView WPF tests to own project

This commit is contained in:
Richard Murillo 2018-04-12 11:55:23 -07:00
Родитель 94d2fc6f4c
Коммит 482c9777bb
5 изменённых файлов: 122 добавлений и 10 удалений

Просмотреть файл

@ -76,6 +76,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests.WebView.Shared",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Toolkit.Win32.UI.Controls", "Microsoft.Toolkit.Win32.UI.Controls\Microsoft.Toolkit.Win32.UI.Controls.csproj", "{78D8B77B-2A55-4037-BCC9-B47806039D23}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests.WebView.WPF", "UnitTests\UnitTests.WebView.WPF\UnitTests.WebView.WPF.csproj", "{2E49400E-B114-4FAE-B743-6CB57B500E31}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
UnitTests\UnitTests.Notifications.Shared\UnitTests.Notifications.Shared.projitems*{982cc826-aacd-4855-9075-430bb6ce40a9}*SharedItemsImports = 13
@ -465,6 +467,22 @@ Global
{78D8B77B-2A55-4037-BCC9-B47806039D23}.Release|x64.Build.0 = Release|Any CPU
{78D8B77B-2A55-4037-BCC9-B47806039D23}.Release|x86.ActiveCfg = Release|Any CPU
{78D8B77B-2A55-4037-BCC9-B47806039D23}.Release|x86.Build.0 = Release|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Debug|ARM.ActiveCfg = Debug|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Debug|ARM.Build.0 = Debug|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Debug|x64.ActiveCfg = Debug|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Debug|x64.Build.0 = Debug|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Debug|x86.ActiveCfg = Debug|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Debug|x86.Build.0 = Debug|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Release|Any CPU.Build.0 = Release|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Release|ARM.ActiveCfg = Release|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Release|ARM.Build.0 = Release|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Release|x64.ActiveCfg = Release|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Release|x64.Build.0 = Release|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Release|x86.ActiveCfg = Release|Any CPU
{2E49400E-B114-4FAE-B743-6CB57B500E31}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -486,6 +504,7 @@ Global
{10129749-7761-49B8-96B9-94BC833BA60B} = {EF53C82B-8622-42C5-A318-CF24A695D913}
{B220BE88-944E-45D1-9248-6FAEF53868A3} = {EF53C82B-8622-42C5-A318-CF24A695D913}
{78D8B77B-2A55-4037-BCC9-B47806039D23} = {F1AFFFA7-28FE-4770-BA48-10D76F3E59BC}
{2E49400E-B114-4FAE-B743-6CB57B500E31} = {EF53C82B-8622-42C5-A318-CF24A695D913}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5403B0C4-F244-4F73-A35C-FE664D0F4345}

Просмотреть файл

@ -17,12 +17,12 @@ using Microsoft.Toolkit.Win32.UI.Controls.Test.WebView.Shared;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Should;
namespace Microsoft.Toolkit.Win32.UI.Controls.Test.WinForms.WebView.FunctionalTests.Wpf.FunctionalTests
namespace Microsoft.Toolkit.Win32.UI.Controls.Test.WPF.WebView.FunctionalTests
{
[TestClass]
public class Class1 : ContextSpecification
{
private Microsoft.Toolkit.Win32.UI.Controls.WPF.WebView _webView;
private Controls.WPF.WebView _webView;
private Window _window;
protected override void Given()
@ -42,7 +42,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Test.WinForms.WebView.FunctionalTe
_window.Closed += (o, e) => { WriteLine("Window.Closed"); };
_webView = new Microsoft.Toolkit.Win32.UI.Controls.WPF.WebView()
_webView = new Controls.WPF.WebView
{
Name = "WebView1",
HorizontalAlignment = HorizontalAlignment.Stretch,
@ -50,7 +50,7 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Test.WinForms.WebView.FunctionalTe
Height = _window.Height,
Width = _window.Width,
MinHeight = 200,
MinWidth = 200,
MinWidth = 200
};
var dp = new DockPanel();
dp.Children.Add(_webView);
@ -103,11 +103,9 @@ namespace Microsoft.Toolkit.Win32.UI.Controls.Test.WinForms.WebView.FunctionalTe
ShowModalWindowCallback callback = ShowModalWindow;
return (bool?)window.Dispatcher.Invoke(callback, DispatcherPriority.Normal, window);
}
else
{
// now we are in the right thread, show modal window
return window.ShowDialog();
}
// now we are in the right thread, show modal window
return window.ShowDialog();
}
private delegate bool? ShowModalWindowCallback(Window window);

Просмотреть файл

@ -0,0 +1,16 @@
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************
using System.Reflection;
[assembly: AssemblyTitle("UnitTests.WebView.WPF")]
[assembly: AssemblyDescription("UnitTests.WebView.WPF")]

Просмотреть файл

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2E49400E-B114-4FAE-B743-6CB57B500E31}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Toolkit.Win32.UI.Controls.Test.WPF.WebView</RootNamespace>
<AssemblyName>Microsoft.Toolkit.Win32.UI.Controls.Test.WPF.WebView</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Release\</OutputPath>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>F:\src\GitHub\rjmurillo\UWPCommunityToolkit\Toolkit.ruleset</CodeAnalysisRuleSet>
<DefineConstants>TRACE</DefineConstants>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<ErrorReport>prompt</ErrorReport>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG</DefineConstants>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<ErrorReport>prompt</ErrorReport>
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="FunctionalTests\Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Microsoft.Toolkit.Win32.UI.Controls\Microsoft.Toolkit.Win32.UI.Controls.csproj">
<Project>{78d8b77b-2a55-4037-bcc9-b47806039d23}</Project>
<Name>Microsoft.Toolkit.Win32.UI.Controls</Name>
</ProjectReference>
<ProjectReference Include="..\UnitTests.WebView.Shared\UnitTests.WebView.Shared.csproj">
<Project>{b220be88-944e-45d1-9248-6faef53868a3}</Project>
<Name>UnitTests.WebView.Shared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<PackageReference Include="InputSimulator">
<Version>1.0.4</Version>
</PackageReference>
<PackageReference Include="MSTest.TestAdapter">
<Version>1.2.1</Version>
</PackageReference>
<PackageReference Include="MSTest.TestFramework">
<Version>1.2.1</Version>
</PackageReference>
<PackageReference Include="Should">
<Version>1.1.20</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="Pack">
<!-- No-op to avoid build error when packing solution from commandline -->
</Target>
</Project>

Просмотреть файл

@ -84,7 +84,6 @@
<Compile Include="FunctionalTests\ProcessFactoryWebViewContextSpecification.cs" />
<Compile Include="FunctionalTests\WebViewContextSpecification.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="FunctionalTests\Wpf.FunctionalTests\Class1.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Microsoft.Toolkit.Win32.UI.Controls\Microsoft.Toolkit.Win32.UI.Controls.csproj">