feature: add integration tests (#1598)

This commit is contained in:
Geoffrey Huntley 2018-08-13 05:21:15 +10:00 коммит произвёл Glenn Watson
Родитель 4702fb581c
Коммит 0f99f94be5
231 изменённых файлов: 20228 добавлений и 0 удалений

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

@ -0,0 +1,33 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27604.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.Android", "IntegrationTests.Android\IntegrationTests.Android.csproj", "{3BC0AC7E-3B3B-4D3F-9CC0-B2BDECC460A6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.Shared", "IntegrationTests.Shared\IntegrationTests.Shared.csproj", "{92988CE1-EA84-4A3A-8921-D3474CC0C87B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3BC0AC7E-3B3B-4D3F-9CC0-B2BDECC460A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BC0AC7E-3B3B-4D3F-9CC0-B2BDECC460A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BC0AC7E-3B3B-4D3F-9CC0-B2BDECC460A6}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{3BC0AC7E-3B3B-4D3F-9CC0-B2BDECC460A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BC0AC7E-3B3B-4D3F-9CC0-B2BDECC460A6}.Release|Any CPU.Build.0 = Release|Any CPU
{3BC0AC7E-3B3B-4D3F-9CC0-B2BDECC460A6}.Release|Any CPU.Deploy.0 = Release|Any CPU
{92988CE1-EA84-4A3A-8921-D3474CC0C87B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92988CE1-EA84-4A3A-8921-D3474CC0C87B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92988CE1-EA84-4A3A-8921-D3474CC0C87B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92988CE1-EA84-4A3A-8921-D3474CC0C87B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {98CE2128-E3D7-4F18-A7F7-46C95788C011}
EndGlobalSection
EndGlobal

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

@ -0,0 +1,19 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".
These files will be deployed with you package and will be accessible using Android's
AssetManager, like this:
public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
InputStream input = Assets.Open ("my_asset.txt");
}
}
Additionally, some Android functions will automatically load asset files:
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");

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

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3BC0AC7E-3B3B-4D3F-9CC0-B2BDECC460A6}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{84dd83c5-0fe3-4294-9419-09e7c8ba324f}</TemplateGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IntegrationTests.Android</RootNamespace>
<AssemblyName>IntegrationTests.Android</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<AndroidLinkMode>None</AndroidLinkMode>
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>PdbOnly</DebugType>
<DebugSymbols>True</DebugSymbols>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Properties\AndroidManifest.xml" />
<None Include="Assets\AboutAssets.txt" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\activity_main.axml">
<SubType>Designer</SubType>
</AndroidResource>
<AndroidResource Include="Resources\layout\content_main.axml">
<SubType>Designer</SubType>
</AndroidResource>
<AndroidResource Include="Resources\values\colors.xml" />
<AndroidResource Include="Resources\values\dimens.xml" />
<AndroidResource Include="Resources\values\ic_launcher_background.xml" />
<AndroidResource Include="Resources\values\strings.xml" />
<AndroidResource Include="Resources\values\styles.xml" />
<AndroidResource Include="Resources\menu\menu_main.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher_round.xml" />
<AndroidResource Include="Resources\mipmap-hdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-hdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-hdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-mdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-mdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-mdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\ic_launcher_round.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\ic_launcher.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\ic_launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\ic_launcher_round.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ReactiveUI">
<Version>8.0.0-alpha0136</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IntegrationTests.Shared\IntegrationTests.Shared.csproj">
<Project>{92988ce1-ea84-4a3a-8921-d3474cc0c87b}</Project>
<Name>IntegrationTests.Shared</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

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

@ -0,0 +1,109 @@
using System;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using IntegrationTests.Shared;
using ReactiveUI;
namespace IntegrationTests.Android
{
[Activity(Label = "@string/app_name", Theme = "@style/AppTheme.NoActionBar", MainLauncher = true)]
public class MainActivity : ReactiveActivity<LoginViewModel>
{
public EditText Username { get; set; }
public EditText Password { get; set; }
public Button Login { get; set; }
public Button Cancel { get; set; }
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.activity_main);
var toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
SetActionBar(toolbar);
Username = FindViewById<EditText>(Resource.Id.Username);
Password = FindViewById<EditText>(Resource.Id.Password);
Login = FindViewById<Button>(Resource.Id.Login);
Cancel = FindViewById<Button>(Resource.Id.Cancel);
ViewModel = new LoginViewModel(RxApp.MainThreadScheduler);
this
.WhenActivated(
disposables =>
{
this
.Bind(ViewModel, vm => vm.UserName, v => v.Username.Text)
.DisposeWith(disposables);
this
.Bind(ViewModel, vm => vm.Password, v => v.Password.Text)
.DisposeWith(disposables);
this
.BindCommand(ViewModel, vm => vm.Login, v => v.Login)
.DisposeWith(disposables);
this
.BindCommand(ViewModel, vm => vm.Cancel, v => v.Cancel)
.DisposeWith(disposables);
this
.ViewModel
.Login
.SelectMany(
result =>
{
if(!result.HasValue)
{
return Observable.Empty<Unit>();
}
if(result.Value)
{
new AlertDialog.Builder(this)
.SetTitle("Login Successful")
.SetMessage("Welcome!")
.Show();
}
else
{
new AlertDialog.Builder(this)
.SetTitle("Login Failed")
.SetMessage("Ah, ah, ah, you didn't say the magic word!")
.Show();
}
return Observable.Return(Unit.Default);
})
.Subscribe()
.DisposeWith(disposables);
});
}
public override bool OnCreateOptionsMenu(IMenu menu)
{
MenuInflater.Inflate(Resource.Menu.menu_main, menu);
return true;
}
public override bool OnOptionsItemSelected(IMenuItem item)
{
int id = item.ItemId;
if (id == Resource.Id.action_settings)
{
return true;
}
return base.OnOptionsItemSelected(item);
}
}
}

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

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="IntegrationTests.Android.IntegrationTests.Android" android:installLocation="auto">
<uses-sdk android:minSdkVersion="23" />
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"></application>
</manifest>

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

@ -0,0 +1,30 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("IntegrationTests.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IntegrationTests.Android")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

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

@ -0,0 +1,44 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable/
icon.png
layout/
main.axml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:
public class R {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.

6537
integrationtests/IntegrationTests.Android/Resources/Resource.Designer.cs сгенерированный Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>

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

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main">
<EditText
android:id="@+id/Username"
android:layout_width="175dp"
android:layout_height="wrap_content"
android:text="Username" />
<EditText
android:id="@+id/Password"
android:layout_width="175dp"
android:layout_height="wrap_content"
android:layout_below="@id/Username"
android:text="Password" />
<Button
android:id="@+id/Login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/Password"
android:text="Login" />
<Button
android:id="@+id/Cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/Password"
android:layout_toRightOf="@id/Login"
android:text="Cancel" />
</RelativeLayout>

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

@ -0,0 +1,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never" />
</menu>

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

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

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

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6087170e47f004c7f5c2330a13ae3b56887f2ebe3d3af6b0f958f322dea53a87
size 1634

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0ebc24c3a238af6e6653b1f4733774c3a443c96de1f163ecfb45f2c0f88dc8f1
size 1441

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:85cfec007adcacce0689063dd4b6afdec9523adace39c06853bfeb9b23414836
size 3552

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1226d41122cae6730fa6e1f44520dc946c08c6b0197dc4700e567467a86584a1
size 1362

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0eac55bd0cb251b388fb6a0d44ecf9aa6cb7768e6179cc28befa965799ee24d8
size 958

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2fd9c4293096c82af2bf9e04305238d07d1972fa87b2f0184a3d6661b51a5cc1
size 2413

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f4eed7967c9459e854d749025a0cb4a0a4eac95c4876e0e5d49271a9222343e7
size 2307

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad347c2bbd69ad09696c79685819e06f66f3fc08b3fda60400a88dc678968333
size 2056

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:74e7d3413541820200276767046d2c3bcd7fd180285a794a325e63fcd8c1283a
size 4858

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:402da3105b03dad36b197e9d9dbb57508c6445dabc393c059ae28a5b225dc54b
size 3871

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e99b97002c6423fcb49589d78821335a4ef0478678698977e6d92a088807feb6
size 3403

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9d09baf6388ffffe01ecfacdf533cb721709a6a88c4d34270992f2801a9b6821
size 8001

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ddf4bf1587c7a8ef6e1eaea586e6dff71e0f3e67972499884fa622ec40c29b6f
size 5016

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0c9515741e081ee8528fbd6c293269a96d1b6d695e621009d8970fb7f0172d5e
size 4889

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a1db075c64da0644e414d3e0e103bd73ef0d18a2db80211d43a037e844e6ae2c
size 10893

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

@ -0,0 +1,4 @@
<resources>
<string name="app_name">IntegrationTests.Android</string>
<string name="action_settings">Settings</string>
</resources>

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

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#2c3e50</color>
<color name="colorPrimaryDark">#1B3147</color>
<color name="colorAccent">#3498db</color>
</resources>

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

@ -0,0 +1,3 @@
<resources>
<dimen name="fab_margin">16dp</dimen>
</resources>

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

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#2C3E50</color>
</resources>

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

@ -0,0 +1,20 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>

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

@ -0,0 +1,23 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.Mac", "IntegrationTests.Mac\IntegrationTests.Mac.csproj", "{84D75BEA-CDE7-4DF9-B51C-468F650BE924}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.Shared", "IntegrationTests.Shared\IntegrationTests.Shared.csproj", "{3A9F323C-EB97-4251-89AB-F705B1718FB7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{84D75BEA-CDE7-4DF9-B51C-468F650BE924}.Debug|x86.ActiveCfg = Debug|x86
{84D75BEA-CDE7-4DF9-B51C-468F650BE924}.Debug|x86.Build.0 = Debug|x86
{84D75BEA-CDE7-4DF9-B51C-468F650BE924}.Release|x86.ActiveCfg = Release|x86
{84D75BEA-CDE7-4DF9-B51C-468F650BE924}.Release|x86.Build.0 = Release|x86
{3A9F323C-EB97-4251-89AB-F705B1718FB7}.Debug|x86.ActiveCfg = Debug|Any CPU
{3A9F323C-EB97-4251-89AB-F705B1718FB7}.Debug|x86.Build.0 = Debug|Any CPU
{3A9F323C-EB97-4251-89AB-F705B1718FB7}.Release|x86.ActiveCfg = Release|Any CPU
{3A9F323C-EB97-4251-89AB-F705B1718FB7}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

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

@ -0,0 +1,29 @@
using AppKit;
using Foundation;
namespace IntegrationTests.Mac
{
[Register("AppDelegate")]
public class AppDelegate : NSApplicationDelegate
{
public AppDelegate()
{
}
public override void DidFinishLaunching(NSNotification notification)
{
// Insert code here to initialize your application
}
public override void WillTerminate(NSNotification notification)
{
// Insert code here to tear down your application
}
[Export("applicationShouldTerminateAfterLastWindowClosed:")]
public override bool ApplicationShouldTerminateAfterLastWindowClosed(NSApplication sender)
{
return true;
}
}
}

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5fee79574e6469b27db4e87249ac43135bb149c1c3b8f9e86ab750e664fcec00
size 8125

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:23b427eef2cb9dfdf4375e69b59c28fc37a3428c8470ea5c9df0a56c5ce5cfd4
size 20798

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c8753cf3682275fc10bdb859cc58f351cc164084106103332bd9a1698d0a312e
size 711

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68f092cf03280792dff8f57fc44d05e01867cf202b5e1ca358f5db467965a59e
size 1484

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:23b427eef2cb9dfdf4375e69b59c28fc37a3428c8470ea5c9df0a56c5ce5cfd4
size 20798

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9a4aded91ae57a8fffb968ece0c166f99d1224f26de5e29759c6254c6e6fb550
size 59335

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68f092cf03280792dff8f57fc44d05e01867cf202b5e1ca358f5db467965a59e
size 1484

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:141313b0304705885f6cdc4d303366f316ee830524751cddb743bf2853be5c87
size 3428

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9a4aded91ae57a8fffb968ece0c166f99d1224f26de5e29759c6254c6e6fb550
size 59335

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9b87eb9ca78f2df0969dc5ee6e265825f84f9f582072822fb97b3755b37ad42a
size 177632

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

@ -0,0 +1,68 @@
{
"images": [
{
"filename": "AppIcon-16.png",
"size": "16x16",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-16@2x.png",
"size": "16x16",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-32.png",
"size": "32x32",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-32@2x.png",
"size": "32x32",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-128.png",
"size": "128x128",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-128@2x.png",
"size": "128x128",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-256.png",
"size": "256x256",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-256@2x.png",
"size": "256x256",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-512.png",
"size": "512x512",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-512@2x.png",
"size": "512x512",
"scale": "2x",
"idiom": "mac"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

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

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

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

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

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

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>IntegrationTests.Mac</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.IntegrationTests.Mac.IntegrationTests-Mac</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
</dict>
</plist>

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

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{84D75BEA-CDE7-4DF9-B51C-468F650BE924}</ProjectGuid>
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>IntegrationTests.Mac</RootNamespace>
<AssemblyName>IntegrationTests.Mac</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EnableCodeSigning>false</EnableCodeSigning>
<CodeSigningKey>Mac Developer</CodeSigningKey>
<CreatePackage>false</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
<IncludeMonoRuntime>false</IncludeMonoRuntime>
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<Profiling>true</Profiling>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EnableCodeSigning>false</EnableCodeSigning>
<CreatePackage>true</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
<IncludeMonoRuntime>true</IncludeMonoRuntime>
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<LinkMode>SdkOnly</LinkMode>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.Mac" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ReactiveUI">
<Version>8.2.5</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-128.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-128%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-16.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-16%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-256.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-256%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-32.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-32%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-512.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-512%402x.png" />
<ImageAsset Include="Assets.xcassets\Contents.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="LoginViewController.cs" />
<Compile Include="LoginViewController.designer.cs">
<DependentUpon>LoginViewController.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Main.storyboard" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IntegrationTests.Shared\IntegrationTests.Shared.csproj">
<Project>{3A9F323C-EB97-4251-89AB-F705B1718FB7}</Project>
<Name>IntegrationTests.Shared</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
</Project>

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

@ -0,0 +1,74 @@
using System;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using AppKit;
using Foundation;
using IntegrationTests.Shared;
using ReactiveUI;
namespace IntegrationTests.Mac
{
public partial class LoginViewController : ReactiveViewController<LoginViewModel>
{
public LoginViewController(IntPtr handle) : base(handle)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
ViewModel = new LoginViewModel(RxApp.MainThreadScheduler);
this.WhenActivated(disposables => {
this.Bind(ViewModel, vm => vm.UserName, v => v.UsernameField.StringValue, username => username ?? string.Empty, username => username)
.DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.Password, v => v.PasswordField.StringValue, password => password ?? string.Empty, password => password)
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.Login, v => v.LoginButton)
.DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.Cancel, v => v.CancelButton)
.DisposeWith(disposables);
ViewModel.Login
.SelectMany(result => {
if (!result.HasValue) {
return Observable.Empty<Unit>();
}
var alert = new NSAlert();
if (result.Value) {
alert.AlertStyle = NSAlertStyle.Informational;
alert.MessageText = "Login Successful";
alert.InformativeText = "Welcome!";
} else {
alert.AlertStyle = NSAlertStyle.Critical;
alert.MessageText = "Login Failed";
alert.InformativeText = "Ah, ah, ah, you didn't say the magic word!";
}
alert.RunModal();
return Observable.Return(Unit.Default);
})
.Subscribe()
.DisposeWith(disposables);
});
}
public override NSObject RepresentedObject
{
get { return base.RepresentedObject; }
set
{
base.RepresentedObject = value;
// Update the view, if already loaded.
}
}
}
}

50
integrationtests/IntegrationTests.Mac/LoginViewController.designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,50 @@
// WARNING
//
// This file has been generated automatically by Visual Studio to store outlets and
// actions made in the UI designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using Foundation;
using System.CodeDom.Compiler;
namespace IntegrationTests.Mac
{
[Register ("LoginViewController")]
partial class LoginViewController
{
[Outlet]
AppKit.NSButton CancelButton { get; set; }
[Outlet]
AppKit.NSButton LoginButton { get; set; }
[Outlet]
AppKit.NSSecureTextField PasswordField { get; set; }
[Outlet]
AppKit.NSTextField UsernameField { get; set; }
void ReleaseDesignerOutlets ()
{
if (UsernameField != null) {
UsernameField.Dispose ();
UsernameField = null;
}
if (PasswordField != null) {
PasswordField.Dispose ();
PasswordField = null;
}
if (CancelButton != null) {
CancelButton.Dispose ();
CancelButton = null;
}
if (LoginButton != null) {
LoginButton.Dispose ();
LoginButton = null;
}
}
}
}

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

@ -0,0 +1,13 @@
using AppKit;
namespace IntegrationTests.Mac
{
static class MainClass
{
static void Main(string[] args)
{
NSApplication.Init();
NSApplication.Main(args);
}
}
}

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

@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14109"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
<capability name="system font weights other than Regular or Bold" minToolsVersion="7.0"/>
</dependencies>
<scenes>
<!--Application-->
<scene sceneID="JPo-4y-FX3">
<objects>
<application id="hnw-xV-0zn" sceneMemberID="viewController">
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="IntegrationTests.Mac" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="IntegrationTests.Mac" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About IntegrationTests.Mac" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide IntegrationTests.Mac" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit IntegrationTests.Mac" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="dMs-cI-mzQ">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Edit" id="5QF-Oa-p0T">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Format" id="jxT-CU-nIS">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="View" id="H8h-7b-M4v">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Window" id="aUF-d1-5bR">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
</items>
</menu>
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="0.0"/>
</scene>
<!--Window Controller-->
<scene sceneID="R2V-B0-nI4">
<objects>
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
<value key="minSize" type="size" width="480" height="270"/>
<value key="maxSize" type="size" width="480" height="270"/>
<connections>
<outlet property="delegate" destination="B8D-0N-5wS" id="RKq-z6-AMS"/>
</connections>
</window>
<connections>
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
</connections>
</windowController>
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="250"/>
</scene>
<!--ReactiveUI-->
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController title="ReactiveUI" id="XfG-lQ-9wD" customClass="LoginViewController" sceneMemberID="viewController">
<view key="view" wantsLayer="YES" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="348" height="169"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<secureTextField verticalHuggingPriority="750" tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="MFg-Hb-ngG">
<rect key="frame" x="136" y="60" width="192" height="22"/>
<constraints>
<constraint firstAttribute="width" constant="192" id="T7c-CE-M8f"/>
</constraints>
<secureTextFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="HLL-da-cIL">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<allowedInputSourceLocales>
<string>NSAllRomanInputSourcesLocaleIdentifier</string>
</allowedInputSourceLocales>
</secureTextFieldCell>
</secureTextField>
<textField verticalHuggingPriority="750" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="YYD-k7-Z2h">
<rect key="frame" x="136" y="92" width="192" height="22"/>
<constraints>
<constraint firstAttribute="width" constant="192" id="RZG-x9-8TN"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="q0e-7Z-ZAI">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="t2g-Gh-cmv">
<rect key="frame" x="134" y="128" width="111" height="21"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Jurassic Lark" id="RMH-ko-nMT">
<font key="font" metaFont="systemSemibold" size="17"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YpW-GK-KfH">
<rect key="frame" x="18" y="95" width="104" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="100" id="2id-ry-sa9"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="User:" id="oYY-hw-jMV">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hzK-U1-q2a">
<rect key="frame" x="18" y="63" width="104" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Password:" id="dM0-oD-bPE">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" tag="3" translatesAutoresizingMaskIntoConstraints="NO" id="mZz-cN-vdQ">
<rect key="frame" x="260" y="13" width="74" height="32"/>
<buttonCell key="cell" type="push" title="Login" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="eYh-ng-vmh">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="GMZ-hr-LLj">
<rect key="frame" x="178" y="13" width="82" height="32"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="zbB-52-bS7">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
</button>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="mZz-cN-vdQ" secondAttribute="bottom" constant="20" id="1Zj-s6-wg2"/>
<constraint firstItem="GMZ-hr-LLj" firstAttribute="baseline" secondItem="mZz-cN-vdQ" secondAttribute="baseline" id="3xc-8k-a0p"/>
<constraint firstItem="t2g-Gh-cmv" firstAttribute="top" secondItem="m2S-Jp-Qdl" secondAttribute="top" constant="20" id="4hr-sz-Zy2"/>
<constraint firstItem="YYD-k7-Z2h" firstAttribute="leading" secondItem="YpW-GK-KfH" secondAttribute="trailing" constant="16" id="8c8-nJ-j3M"/>
<constraint firstItem="t2g-Gh-cmv" firstAttribute="leading" secondItem="YYD-k7-Z2h" secondAttribute="leading" id="AHt-6M-3KD"/>
<constraint firstItem="mZz-cN-vdQ" firstAttribute="leading" secondItem="GMZ-hr-LLj" secondAttribute="trailing" constant="12" id="GnB-FB-RzH"/>
<constraint firstItem="MFg-Hb-ngG" firstAttribute="leading" secondItem="hzK-U1-q2a" secondAttribute="trailing" constant="16" id="JP4-CK-IYy"/>
<constraint firstAttribute="trailing" secondItem="mZz-cN-vdQ" secondAttribute="trailing" constant="20" id="OcX-Eb-M6k"/>
<constraint firstItem="hzK-U1-q2a" firstAttribute="top" secondItem="YpW-GK-KfH" secondAttribute="bottom" constant="15" id="Tb0-vg-aNk"/>
<constraint firstItem="YpW-GK-KfH" firstAttribute="leading" secondItem="m2S-Jp-Qdl" secondAttribute="leading" constant="20" id="foQ-Jo-jfZ"/>
<constraint firstItem="hzK-U1-q2a" firstAttribute="leading" secondItem="m2S-Jp-Qdl" secondAttribute="leading" constant="20" id="hLR-60-f1B"/>
<constraint firstItem="hzK-U1-q2a" firstAttribute="baseline" secondItem="MFg-Hb-ngG" secondAttribute="baseline" id="iVZ-bt-hmA"/>
<constraint firstItem="YpW-GK-KfH" firstAttribute="top" secondItem="t2g-Gh-cmv" secondAttribute="bottom" constant="16" id="iu9-qU-Eqn"/>
<constraint firstItem="YYD-k7-Z2h" firstAttribute="baseline" secondItem="YpW-GK-KfH" secondAttribute="baseline" id="pEX-eh-DuU"/>
<constraint firstItem="hzK-U1-q2a" firstAttribute="width" secondItem="YpW-GK-KfH" secondAttribute="width" id="xBl-0C-0FE"/>
</constraints>
</view>
<connections>
<outlet property="CancelButton" destination="GMZ-hr-LLj" id="4pS-Js-xhn"/>
<outlet property="LoginButton" destination="mZz-cN-vdQ" id="aeP-MD-lMC"/>
<outlet property="PasswordField" destination="MFg-Hb-ngG" id="K5m-P9-yP9"/>
<outlet property="UsernameField" destination="YYD-k7-Z2h" id="soT-ne-Mvx"/>
</connections>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="627"/>
</scene>
</scenes>
</document>

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

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27604.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.Shared.Tests", "IntegrationTests.Shared.Tests\IntegrationTests.Shared.Tests.csproj", "{6DF6F047-A892-43FA-8C51-F4BE5C7664A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.Shared", "IntegrationTests.Shared\IntegrationTests.Shared.csproj", "{47523D7F-60A4-4DDE-A645-68BD83096708}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6DF6F047-A892-43FA-8C51-F4BE5C7664A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6DF6F047-A892-43FA-8C51-F4BE5C7664A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6DF6F047-A892-43FA-8C51-F4BE5C7664A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6DF6F047-A892-43FA-8C51-F4BE5C7664A0}.Release|Any CPU.Build.0 = Release|Any CPU
{47523D7F-60A4-4DDE-A645-68BD83096708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47523D7F-60A4-4DDE-A645-68BD83096708}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47523D7F-60A4-4DDE-A645-68BD83096708}.Release|Any CPU.ActiveCfg = Release|Any CPU
{47523D7F-60A4-4DDE-A645-68BD83096708}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B2DAEE22-18F1-4ECE-A503-903329E896E4}
EndGlobalSection
EndGlobal

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

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace IntegrationTests.Shared.Tests
{
public static class BuilderExtensions
{
public static TBuilder With<TBuilder, TField>(this TBuilder @this, ref TField field, TField value)
where TBuilder : IBuilder
{
field = value;
return @this;
}
public static TBuilder With<TBuilder, TField>(this TBuilder @this, ref List<TField> field, IEnumerable<TField> values)
where TBuilder : IBuilder
{
if (values == null) {
field = null;
} else {
field.AddRange(values);
}
return @this;
}
public static TBuilder With<TBuilder, TField>(this TBuilder @this, ref List<TField> field, TField value)
where TBuilder : IBuilder
{
field.Add(value);
return @this;
}
}
}

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

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using ReactiveUI;
using Splat;
using Xunit;
namespace IntegrationTests.Shared.Tests.Features.Initialize
{
public class DependencyResolverMixinsTests
{
public Dictionary<Type, List<Type>> GetServicesThatShouldRegistered()
{
var serviceTypeToImplementationTypes = new Dictionary<Type, List<Type>>();
var registrations = new Registrations();
registrations.Register((factory, serviceType) => {
if (serviceTypeToImplementationTypes.TryGetValue(serviceType, out var implementationTypes) == false) {
implementationTypes = new List<Type>();
serviceTypeToImplementationTypes.Add(serviceType, implementationTypes);
}
implementationTypes.Add(factory().GetType());
});
var platformRegistrationsType = Type.GetType("ReactiveUI.Wpf.Registrations, ReactiveUI.Wpf");
if (platformRegistrationsType == null)
platformRegistrationsType = Type.GetType("ReactiveUI.XamForms.Registrations, ReactiveUI.XamForms");
if (platformRegistrationsType == null)
platformRegistrationsType = Type.GetType("ReactiveUI.Winforms.Registrations, ReactiveUI.Winforms");
if (platformRegistrationsType != null) {
var platformRegistrations = Activator.CreateInstance(platformRegistrationsType);
var register = platformRegistrationsType.GetMethod("Register");
var registerParameter = new Action<Func<object>, Type>((factory, serviceType) => {
if (serviceTypeToImplementationTypes.TryGetValue(serviceType, out var implementationTypes) == false) {
implementationTypes = new List<Type>();
serviceTypeToImplementationTypes.Add(serviceType, implementationTypes);
}
implementationTypes.Add(factory().GetType());
});
register.Invoke(platformRegistrations, new object[] { registerParameter });
}
return serviceTypeToImplementationTypes;
}
[Fact]
public void Registrations_Should_Resolve_Correctly()
{
foreach(var shouldRegistered in GetServicesThatShouldRegistered()) {
var resolvedServices = Locator.Current.GetServices(shouldRegistered.Key);
Assert.Equal(shouldRegistered.Value.Count, resolvedServices.Count());
foreach(var implementationType in shouldRegistered.Value) {
var isRegistered = resolvedServices.Any(rs => rs.GetType() == implementationType);
Assert.Equal(true, isRegistered);
}
}
}
}
}

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

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Reactive.Concurrency;
using System.Text;
namespace IntegrationTests.Shared.Tests.Features.Login
{
public sealed class LoginViewModelBuilder : IBuilder
{
private string _userName;
private string _password;
private IScheduler _mainScheduler;
public LoginViewModelBuilder()
{
_mainScheduler = CurrentThreadScheduler.Instance;
}
public LoginViewModelBuilder WithUserName(string username) => this.With(ref _userName, username);
public LoginViewModelBuilder WithPassword(string password) => this.With(ref _password, password);
public LoginViewModelBuilder WithScheduler(IScheduler mainScheduler) => this.With(ref _mainScheduler, mainScheduler);
public LoginViewModel Build()
{
var result = new LoginViewModel(_mainScheduler)
{
UserName = _userName,
Password = _password,
};
return result;
}
public static implicit operator LoginViewModel(LoginViewModelBuilder builder) =>
builder.Build();
}
}

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

@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using System.Text;
using FluentAssertions;
using Microsoft.Reactive.Testing;
using ReactiveUI.Testing;
using Xunit;
namespace IntegrationTests.Shared.Tests.Features.Login
{
public class LoginViewModelTests
{
[Fact]
public void LoginButton_IsDisabled_ByDefault()
{
var sut = new LoginViewModelBuilder()
.Build();
sut.Login.CanExecute
.FirstAsync().Wait()
.Should().BeFalse();;
}
[Theory]
[InlineData(null, null)]
[InlineData("", null)]
[InlineData(null, "")]
[InlineData(" ", "")]
[InlineData("", " ")]
[InlineData(" ", " ")]
public void LoginButton_IsDisabled_WhenUserNameOrPassword_IsEmpty(string userName, string password)
{
var sut = new LoginViewModelBuilder()
.WithUserName(userName)
.WithPassword(password)
.Build();
sut.Login.CanExecute
.FirstAsync().Wait()
.Should().BeFalse();;
}
[Theory]
[InlineData("coolusername", "excellentpassword")]
public void LoginButton_IsEnabled_WhenUserNameAndPassword_IsNotEmptyAsync(string userName, string password)
{
var sut = new LoginViewModelBuilder()
.WithUserName(userName)
.WithPassword(password)
.Build();
sut.Login.CanExecute
.FirstAsync().Wait()
.Should().BeTrue();
}
[Fact]
public void CancelButton_IsDisabled_WhenNot_LoggingIn()
{
var sut = new LoginViewModelBuilder()
.Build();
sut.Cancel.CanExecute
.FirstAsync().Wait()
.Should().BeFalse();;
}
[Fact]
public void CancelButton_Cancels_Login()
{
(new TestScheduler()).With(sched => {
var sut = new LoginViewModelBuilder()
.WithScheduler(sched)
.WithUserName("coolusername")
.WithPassword("excellentpassword")
.Build();
sut.Login.Subscribe(x => {
x.Should().BeTrue();
});
//sut.Login.Execute();
sched.AdvanceByMs(TimeSpan.FromSeconds(1).Milliseconds);
sut.Cancel.CanExecute
.FirstAsync().Wait()
.Should().BeTrue();
//sut.Cancel.Execute();
});
}
[Fact]
public void CancelButton_IsAvailableUntil_TwoSeconds()
{
(new TestScheduler()).With(sched => {
var sut = new LoginViewModelBuilder()
.WithScheduler(sched)
.WithUserName("coolusername")
.WithPassword("excellentpassword")
.Build();
sut.Login.Execute().Subscribe();
sut.Cancel.CanExecute
.FirstAsync().Wait()
.Should().BeFalse();;
// 50ms
sched.AdvanceByMs(50);
sut.Cancel.CanExecute
.FirstAsync().Wait()
.Should().BeTrue();
// 1sec 50ms
sched.AdvanceByMs(TimeSpan.FromSeconds(1).Milliseconds);
sut.Cancel.CanExecute
.FirstAsync().Wait()
.Should().BeTrue();
// 2sec 50sms
sched.AdvanceByMs(TimeSpan.FromSeconds(1).Milliseconds);
sut.Cancel.CanExecute
.FirstAsync().Wait()
.Should().BeFalse();;
});
}
[Fact]
public void User_CannotLogin_WithIncorrect_Password()
{
var sut = new LoginViewModelBuilder()
.WithUserName("coolusername")
.WithPassword("incorrectpassword")
.Build();
Assert.False(true);
}
[Fact]
public void User_CanLogin_WithCorrect_Password()
{
var sut = new LoginViewModelBuilder()
.WithUserName("coolusername")
.WithPassword("Mr. Goodbytes")
.Build();
Assert.False(true);
}
}
}

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

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace IntegrationTests.Shared.Tests
{
public interface IBuilder
{
}
}

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

@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.0-beta.2.build3984" />
<PackageReference Include="xunit.runner.console" Version="2.4.0-beta.2.build3984" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0-beta.2.build3984" />
<PackageReference Include="Xunit.StaFact" Version="0.2.9" />
<PackageReference Include="FluentAssertions" Version="5.3.0" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="[3.1.1,4)" />
<PackageReference Include="ReactiveUI" Version="*" />
<PackageReference Include="ReactiveUI.Testing" Version="*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IntegrationTests.Shared\IntegrationTests.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
<Reference Include="UIAutomationTypes" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
</Project>

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

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="xunit.methodDisplay" value="method"/>
</appSettings>
</configuration>

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

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="genesis.ensure" Version="2.0.0" />
<PackageReference Include="ReactiveUI" Version="8.0.0-alpha0136" />
</ItemGroup>
</Project>

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

@ -0,0 +1,65 @@
using Genesis.Ensure;
using ReactiveUI;
using System;
using System.Reactive;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace IntegrationTests.Shared
{
public class LoginViewModel : ReactiveObject
{
private string _userName;
private string _password;
private IScheduler _mainScheduler;
public LoginViewModel(IScheduler mainScheduler)
{
Ensure.ArgumentNotNull(mainScheduler, nameof(mainScheduler));
_mainScheduler = mainScheduler;
var canLogin = this
.WhenAnyValue(
vm => vm.UserName,
vm => vm.Password,
(user, password) => !string.IsNullOrWhiteSpace(user) && !string.IsNullOrWhiteSpace(password)
);
Login = ReactiveCommand.CreateFromObservable(
() =>
Observable
.StartAsync(LoginAsync)
.TakeUntil(Cancel),
canLogin, _mainScheduler);
Cancel = ReactiveCommand.Create(() => { }, Login.IsExecuting, _mainScheduler);
}
public ReactiveCommand<Unit, bool?> Login { get; }
public ReactiveCommand<Unit, Unit> Cancel { get; }
public string UserName
{
get => _userName;
set => this.RaiseAndSetIfChanged(ref _userName, value);
}
public string Password
{
get => _password;
set => this.RaiseAndSetIfChanged(ref _password, value);
}
private async Task<bool?> LoginAsync(CancellationToken ct)
{
var result = Password == "Mr. Goodbytes";
await Task.Delay(TimeSpan.FromSeconds(2), ct);
return result;
}
}
}

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

@ -0,0 +1,67 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27604.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.UWP", "IntegrationTests.UWP\IntegrationTests.UWP.csproj", "{01B889B1-5492-403B-BB2C-947FDE4130F7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.Shared", "IntegrationTests.Shared\IntegrationTests.Shared.csproj", "{B77110E5-D591-4163-9E77-74682345FDF8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|Any CPU.ActiveCfg = Debug|x86
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|Any CPU.Build.0 = Debug|x86
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|Any CPU.Deploy.0 = Debug|x86
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|ARM.ActiveCfg = Debug|ARM
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|ARM.Build.0 = Debug|ARM
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|ARM.Deploy.0 = Debug|ARM
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|x64.ActiveCfg = Debug|x64
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|x64.Build.0 = Debug|x64
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|x64.Deploy.0 = Debug|x64
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|x86.ActiveCfg = Debug|x86
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|x86.Build.0 = Debug|x86
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Debug|x86.Deploy.0 = Debug|x86
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|Any CPU.ActiveCfg = Release|x86
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|ARM.ActiveCfg = Release|ARM
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|ARM.Build.0 = Release|ARM
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|ARM.Deploy.0 = Release|ARM
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|x64.ActiveCfg = Release|x64
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|x64.Build.0 = Release|x64
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|x64.Deploy.0 = Release|x64
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|x86.ActiveCfg = Release|x86
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|x86.Build.0 = Release|x86
{01B889B1-5492-403B-BB2C-947FDE4130F7}.Release|x86.Deploy.0 = Release|x86
{B77110E5-D591-4163-9E77-74682345FDF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Debug|ARM.ActiveCfg = Debug|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Debug|ARM.Build.0 = Debug|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Debug|x64.ActiveCfg = Debug|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Debug|x64.Build.0 = Debug|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Debug|x86.ActiveCfg = Debug|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Debug|x86.Build.0 = Debug|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Release|Any CPU.Build.0 = Release|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Release|ARM.ActiveCfg = Release|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Release|ARM.Build.0 = Release|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Release|x64.ActiveCfg = Release|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Release|x64.Build.0 = Release|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Release|x86.ActiveCfg = Release|Any CPU
{B77110E5-D591-4163-9E77-74682345FDF8}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {013AE69A-2CAD-4B23-8873-DCE328F12CEB}
EndGlobalSection
EndGlobal

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

@ -0,0 +1,8 @@
<Application
x:Class="IntegrationTests.UWP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:IntegrationTests.UWP"
RequestedTheme="Light">
</Application>

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

@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace IntegrationTests.UWP
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (e.PrelaunchActivated == false)
{
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a41a053b3fc3b0c109720ccd437a19725ae9163ea75990222a12b596b9c7ca76
size 1430

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a3382b0b1b834e95b888f06d483dc2d78fa1b3855e0683d5cfbd5167be9731a6
size 7700

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7f3cb5738e8f05544445f79996a313f8b47dee22dbc9c7be859d2707710f0c73
size 2937

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:594492a25070951d7462c091d9f899a66f55ba992bb9b05d98d50f67cdfb2abe
size 1647

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:48cf9c22156a0b3d77982641f972785e7861a7257f7bcf155be7d5a12e1aa3d8
size 1255

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ae95e99a96251abaf8de15c9cdaddb8cefb1b8b320b10a4f1f4e1dc3c25c1b1a
size 1451

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b5b7754832c08e58faacfe64ea4b9f8b59b52a658e4eea4aab3790cfb89faa03
size 3204

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

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{01B889B1-5492-403B-BB2C-947FDE4130F7}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IntegrationTests.UWP</RootNamespace>
<AssemblyName>IntegrationTests.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<PackageCertificateKeyFile>IntegrationTests.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="LoginControl.xaml.cs">
<DependentUpon>LoginControl.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="IntegrationTests.UWP_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="LoginControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.1.0-preview1-26328-03</Version>
</PackageReference>
<PackageReference Include="ReactiveUI">
<Version>8.0.0-alpha0136</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IntegrationTests.Shared\IntegrationTests.Shared.csproj">
<Project>{B77110E5-D591-4163-9E77-74682345FDF8}</Project>
<Name>IntegrationTests.Shared</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

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

@ -0,0 +1,40 @@
<local:LoginControlBase
x:Class="IntegrationTests.UWP.LoginControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:IntegrationTests.UWP"
xmlns:vms="clr-namespace:IntegrationTests.Shared;assembly=IntegrationTests.Shared"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Grid>
<TextBox x:Name="Username"
Text="Username"
HorizontalAlignment="Left"
Height="23" Margin="10,70,0,0"
TextWrapping="Wrap"
VerticalAlignment="Top"
Width="175"/>
<PasswordBox x:Name="Password"
HorizontalAlignment="Left"
Height="23"
Margin="10,110,0,0"
VerticalAlignment="Top"
Width="175"/>
<Button x:Name="Login"
Content="Login"
HorizontalAlignment="Left"
Margin="10,156,0,0"
VerticalAlignment="Top"
Width="78"/>
<Button x:Name="Cancel"
Content="Cancel"
HorizontalAlignment="Left"
Margin="108,156,0,0"
VerticalAlignment="Top"
Width="77"/>
</Grid>
</local:LoginControlBase>

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

@ -0,0 +1,69 @@
using IntegrationTests.Shared;
using ReactiveUI;
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reactive.Windows.Foundation;
using Windows.UI.Popups;
namespace IntegrationTests.UWP
{
public class LoginControlBase : ReactiveUserControl<LoginViewModel> { }
public partial class LoginControl : LoginControlBase
{
public LoginControl()
{
this.InitializeComponent();
ViewModel = new LoginViewModel(RxApp.MainThreadScheduler)
{
UserName = "",
Password = ""
};
this
.WhenActivated(
disposables =>
{
this
.Bind(ViewModel, vm => vm.UserName, v => v.Username.Text)
.DisposeWith(disposables);
this
.Bind(ViewModel, vm => vm.Password, v => v.Password.Password)
.DisposeWith(disposables);
this
.BindCommand(ViewModel, vm => vm.Login, v => v.Login)
.DisposeWith(disposables);
this
.BindCommand(ViewModel, vm => vm.Cancel, v => v.Cancel)
.DisposeWith(disposables);
this
.ViewModel
.Login
.SelectMany(
result =>
{
if (!result.HasValue)
{
return Observable.Empty<IUICommand>();
}
if (result.Value)
{
var dialog = new MessageDialog("Login Successful", "Welcome!");
return dialog.ShowAsync().ToObservable();
}
else
{
var dialog = new MessageDialog("Login Failed", "Ah, ah, ah, you didn't say the magic word!");
return dialog.ShowAsync().ToObservable();
}
})
.Subscribe()
.DisposeWith(disposables);
});
}
}
}

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

@ -0,0 +1,13 @@
<Page
x:Class="IntegrationTests.UWP.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:IntegrationTests.UWP"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<local:LoginControl/>
</Grid>
</Page>

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

@ -0,0 +1,17 @@
using Windows.UI.Xaml.Controls;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
namespace IntegrationTests.UWP
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
}
}

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

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">
<Identity
Name="a33b0811-a24c-4b38-b294-0f1a670dc3e4"
Publisher="CN=ghuntley"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="a33b0811-a24c-4b38-b294-0f1a670dc3e4" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>IntegrationTests.UWP</DisplayName>
<PublisherDisplayName>ghuntley</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="IntegrationTests.UWP.App">
<uap:VisualElements
DisplayName="IntegrationTests.UWP"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="IntegrationTests.UWP"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

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

@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("IntegrationTests.UWP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IntegrationTests.UWP")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

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

@ -0,0 +1,31 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Serialize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>

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

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27604.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.WPF", "IntegrationTests.WPF\IntegrationTests.WPF.csproj", "{1F07CDC4-B1B7-4D91-8F07-9AE1C648E316}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.Shared", "IntegrationTests.Shared\IntegrationTests.Shared.csproj", "{C6ED18F6-26D2-46B0-A086-F43BBF72FA78}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1F07CDC4-B1B7-4D91-8F07-9AE1C648E316}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F07CDC4-B1B7-4D91-8F07-9AE1C648E316}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F07CDC4-B1B7-4D91-8F07-9AE1C648E316}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F07CDC4-B1B7-4D91-8F07-9AE1C648E316}.Release|Any CPU.Build.0 = Release|Any CPU
{C6ED18F6-26D2-46B0-A086-F43BBF72FA78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6ED18F6-26D2-46B0-A086-F43BBF72FA78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6ED18F6-26D2-46B0-A086-F43BBF72FA78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6ED18F6-26D2-46B0-A086-F43BBF72FA78}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B27D67EE-6BB9-43A5-978C-BD11BE63466C}
EndGlobalSection
EndGlobal

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

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />
</startup>
</configuration>

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

@ -0,0 +1,17 @@
<Application x:Class="IntegrationTests.WPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:IntegrationTests.WPF"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

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

@ -0,0 +1,22 @@
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace IntegrationTests.WPF
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public App()
{
}
}
}

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

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1F07CDC4-B1B7-4D91-8F07-9AE1C648E316}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>IntegrationTests.WPF</RootNamespace>
<AssemblyName>IntegrationTests.WPF</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="LoginControl.xaml.cs">
<DependentUpon>LoginControl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControlExtensions.cs" />
<Page Include="LoginControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IntegrationTests.Shared\IntegrationTests.Shared.csproj">
<Project>{322be1b9-3519-4fb7-b2af-fd1f8df12616}</Project>
<Name>IntegrationTests.Shared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="MahApps.Metro">
<Version>1.6.1</Version>
</PackageReference>
<PackageReference Include="ReactiveUI">
<Version>8.0.0-alpha0136</Version>
</PackageReference>
<PackageReference Include="ReactiveUI.Events.WPF">
<Version>8.0.0-alpha0136</Version>
</PackageReference>
<PackageReference Include="ReactiveUI.WPF">
<Version>8.0.0-alpha0136</Version>
</PackageReference>
<PackageReference Include="System.Reactive">
<Version>3.1.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

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

@ -0,0 +1,46 @@
<rxui:ReactiveUserControl
xmlns:rxui="http://reactiveui.net"
x:TypeArguments="vms:LoginViewModel"
x:Class="IntegrationTests.WPF.LoginControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:IntegrationTests.WPF"
xmlns:vms="clr-namespace:IntegrationTests.Shared;assembly=IntegrationTests.Shared"
mc:Ignorable="d">
<Grid>
<TextBox x:Name="Username"
Text="Username"
HorizontalAlignment="Left"
Height="23" Margin="10,70,0,0"
TextWrapping="Wrap"
VerticalAlignment="Top"
Width="175"/>
<PasswordBox x:Name="Password"
HorizontalAlignment="Left"
Height="23"
Margin="10,110,0,0"
VerticalAlignment="Top"
Width="175"/>
<Button x:Name="Login"
Content="Login"
HorizontalAlignment="Left"
Margin="10,156,0,0"
VerticalAlignment="Top"
Width="78"/>
<Button x:Name="Cancel"
Content="Cancel"
HorizontalAlignment="Left"
Margin="108,156,0,0"
VerticalAlignment="Top"
Width="77"/>
</Grid>
</rxui:ReactiveUserControl>

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

@ -0,0 +1,83 @@
using IntegrationTests.Shared;
using MahApps.Metro.Controls.Dialogs;
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace IntegrationTests.WPF
{
/// <summary>
/// Interaction logic for LoginControl.xaml
/// </summary>
public partial class LoginControl : ReactiveUserControl<LoginViewModel>
{
public LoginControl()
{
InitializeComponent();
ViewModel = new LoginViewModel(RxApp.MainThreadScheduler);
this
.WhenActivated(
disposables =>
{
this
.Bind(ViewModel, vm => vm.UserName, v => v.Username.Text)
.DisposeWith(disposables);
this
.BindCommand(ViewModel, vm => vm.Login, v => v.Login)
.DisposeWith(disposables);
this
.BindCommand(ViewModel, vm => vm.Cancel, v => v.Cancel)
.DisposeWith(disposables);
// we marshal changes to password manually because WPF's
// PasswordBox.Password property doesn't support change notifications
this
.Password
.Events()
.PasswordChanged
.Select(_ => Password.Password)
.Subscribe(x => ViewModel.Password = x)
.DisposeWith(disposables);
this
.ViewModel
.Login
.SelectMany(
result =>
{
if (!result.HasValue)
{
return Observable.Empty<MessageDialogResult>();
}
if (result.Value)
{
return this.ShowMessage("Login Successful", "Welcome!");
}
else
{
return this.ShowMessage("Login Failed", "Ah, ah, ah, you didn't say the magic word!");
}
})
.Subscribe()
.DisposeWith(disposables);
});
}
}
}

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

@ -0,0 +1,15 @@
<ma:MetroWindow
x:Class="IntegrationTests.WPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:ma="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:IntegrationTests.WPF"
mc:Ignorable="d"
Height="227"
Width="202">
<local:LoginControl/>
</ma:MetroWindow>

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

@ -0,0 +1,34 @@
using IntegrationTests.Shared;
using MahApps.Metro.Controls.Dialogs;
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace IntegrationTests.WPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
}
}
}

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

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("IntegrationTests.WPF")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IntegrationTests.WPF")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

71
integrationtests/IntegrationTests.WPF/Properties/Resources.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace IntegrationTests.WPF.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("IntegrationTests.WPF.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

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

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

30
integrationtests/IntegrationTests.WPF/Properties/Settings.Designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace IntegrationTests.WPF.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

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

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

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

@ -0,0 +1,29 @@
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Threading.Tasks;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace IntegrationTests.WPF
{
public static class UserControlExtensions
{
public static IObservable<MessageDialogResult> ShowMessage(
this UserControl @this,
string title,
string message,
MessageDialogStyle style = MessageDialogStyle.Affirmative,
MetroDialogSettings settings = null)
{
var window = (MetroWindow)Window.GetWindow(@this);
return window
.ShowMessageAsync(title, message, style, settings)
.ToObservable();
}
}
}

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

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27604.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.Shared", "IntegrationTests.Shared\IntegrationTests.Shared.csproj", "{E22DE136-2503-4BBE-93BF-23FB352497EA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests.WinForms", "IntegrationTests.WinForms\IntegrationTests.WinForms.csproj", "{DF25062C-CD9E-4F64-B3A9-AF0DC656CB52}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E22DE136-2503-4BBE-93BF-23FB352497EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E22DE136-2503-4BBE-93BF-23FB352497EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E22DE136-2503-4BBE-93BF-23FB352497EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E22DE136-2503-4BBE-93BF-23FB352497EA}.Release|Any CPU.Build.0 = Release|Any CPU
{DF25062C-CD9E-4F64-B3A9-AF0DC656CB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF25062C-CD9E-4F64-B3A9-AF0DC656CB52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF25062C-CD9E-4F64-B3A9-AF0DC656CB52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF25062C-CD9E-4F64-B3A9-AF0DC656CB52}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E656E543-FB74-4C59-AB15-C08C06372DBA}
EndGlobalSection
EndGlobal

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

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>

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

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DF25062C-CD9E-4F64-B3A9-AF0DC656CB52}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>IntegrationTests.WinForms</RootNamespace>
<AssemblyName>IntegrationTests.WinForms</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="LoginControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="LoginControl.Designer.cs">
<DependentUpon>LoginControl.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="LoginControl.resx">
<DependentUpon>LoginControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IntegrationTests.Shared\IntegrationTests.Shared.csproj">
<Project>{E22DE136-2503-4BBE-93BF-23FB352497EA}</Project>
<Name>IntegrationTests.Shared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="ReactiveUI, Version=8.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ReactiveUI.8.0.0-alpha0136\lib\net461\ReactiveUI.dll</HintPath>
</Reference>
<Reference Include="ReactiveUI.Winforms, Version=8.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ReactiveUI.WinForms.8.0.0-alpha0136\lib\net461\ReactiveUI.Winforms.dll</HintPath>
</Reference>
<Reference Include="Splat, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Splat.4.0.0\lib\net461\Splat.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Drawing.Primitives.4.3.0\lib\net45\System.Drawing.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Core, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Interfaces, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Linq, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.PlatformServices, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.PlatformServices.3.1.1\lib\net46\System.Reactive.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Windows.Threading, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reactive.Windows.Threading.3.1.1\lib\net45\System.Reactive.Windows.Threading.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше