Skip to content

Commit

Permalink
Merge pull request #5 from Wintellect/fsharp-ui-tests
Browse files Browse the repository at this point in the history
Finish the calculation part of the demo
  • Loading branch information
jwood803 committed Aug 14, 2015
2 parents e49964a + df9e2ec commit ba981df
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 24 deletions.
20 changes: 10 additions & 10 deletions UITestDemo/Droid/UITestDemo.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<AndroidApplication>True</AndroidApplication>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AssemblyName>UITestDemo.Droid</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v5.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -42,23 +42,23 @@
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="Xamarin.Android.Support.v4">
<HintPath>..\packages\Xamarin.Android.Support.v4.22.2.1.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.Android">
<HintPath>..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.1.4.4.6392\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
</Reference>
<Reference Include="FormsViewGroup">
<HintPath>..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.1.4.4.6392\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.1.4.4.6392\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.1.4.4.6392\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.1.4.3.6376\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Android.Support.v4">
<HintPath>..\packages\Xamarin.Android.Support.v4.22.2.1.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.1.4.4.6392\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -89,5 +89,5 @@
<AndroidResource Include="Resources\drawable-xxhdpi\icon.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.1.4.3.6376\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.4.3.6376\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Forms.1.4.4.6392\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.4.4.6392\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
</Project>
2 changes: 1 addition & 1 deletion UITestDemo/Droid/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Android.Support.v4" version="22.2.1.0" targetFramework="MonoAndroid50" />
<package id="Xamarin.Forms" version="1.4.3.6376" targetFramework="MonoAndroid50" />
<package id="Xamarin.Forms" version="1.4.4.6392" targetFramework="MonoAndroid51" />
</packages>
2 changes: 1 addition & 1 deletion UITestDemo/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<BoxView Color="#BCBCBC" HeightRequest="1" />

<Label Text="Calculate" FontAttributes="Bold" FontSize="14" HorizontalOptions="Center" VerticalOptions="Center" />
<Button HorizontalOptions="Center" VerticalOptions="Center" Text="2 + 2 = ?" Clicked="CalculateClicked" />
<Button HorizontalOptions="Center" VerticalOptions="Center" Text="{Binding AddString}" Clicked="CalculateClicked" />
</StackLayout>


Expand Down
8 changes: 7 additions & 1 deletion UITestDemo/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ namespace UITestDemo
{
public partial class MainPage : ContentPage
{
MainPageViewModel _mainViewModel;

public MainPage()
{
InitializeComponent();

_mainViewModel = new MainPageViewModel();

BindingContext = _mainViewModel;
}

async void DetailClicked(object sender, EventArgs args)
Expand All @@ -17,7 +23,7 @@ async void DetailClicked(object sender, EventArgs args)

void CalculateClicked(object sender, EventArgs args)
{
Add.AddItems(2, 2);
_mainViewModel.UpdateButtonText();
}
}
}
48 changes: 48 additions & 0 deletions UITestDemo/MainPageViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace UITestDemo
{
public class MainPageViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged = delegate {};
public void RaisePropertyChanged([CallerMemberName] string propertyName = "")
{
var handler = PropertyChanged;

if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}

private string addString;
public string AddString
{
get
{
return addString;
}
set
{
if (addString != value)
{
addString = value;
RaisePropertyChanged();
}
}
}

public MainPageViewModel()
{
this.AddString = "2 + 2 = ?";
}

public void UpdateButtonText()
{
var result = Add.AddItems(2, 2);

this.AddString = "2 + 2 = " + result;
}
}
}
9 changes: 5 additions & 4 deletions UITestDemo/UITestDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
<DependentUpon>DetailPage.xaml</DependentUpon>
</Compile>
<Compile Include="Add.cs" />
<Compile Include="MainPageViewModel.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="packages\Xamarin.Forms.1.4.4.6386\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('packages\Xamarin.Forms.1.4.4.6386\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<Import Project="packages\Xamarin.Forms.1.4.4.6392\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('packages\Xamarin.Forms.1.4.4.6392\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<ItemGroup>
<EmbeddedResource Include="MainPage.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
Expand All @@ -52,13 +53,13 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Xamarin.Forms.Core">
<HintPath>packages\Xamarin.Forms.1.4.4.6386\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>packages\Xamarin.Forms.1.4.4.6392\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>packages\Xamarin.Forms.1.4.4.6386\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>packages\Xamarin.Forms.1.4.4.6392\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>packages\Xamarin.Forms.1.4.4.6386\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>packages\Xamarin.Forms.1.4.4.6392\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions UITestDemo/iOS/UITestDemo.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@
<HintPath>..\packages\Xamarin.TestCloud.Agent.0.14.1\lib\Xamarin.iOS10\Calabash.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\packages\Xamarin.Forms.1.4.3.6376\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.1.4.4.6392\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.1.4.3.6376\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.1.4.4.6392\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.1.4.3.6376\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.1.4.4.6392\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.1.4.3.6376\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.1.4.4.6392\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -121,5 +121,5 @@
<ITunesArtwork Include="ITunesArtwork%402x" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.1.4.3.6376\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.4.3.6376\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Forms.1.4.4.6392\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.4.4.6392\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
</Project>
2 changes: 1 addition & 1 deletion UITestDemo/iOS/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Forms" version="1.4.3.6376" targetFramework="xamarinios10" />
<package id="Xamarin.Forms" version="1.4.4.6392" targetFramework="xamarinios10" />
<package id="Xamarin.TestCloud.Agent" version="0.14.1" targetFramework="xamarinios10" />
</packages>
2 changes: 1 addition & 1 deletion UITestDemo/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Forms" version="1.4.4.6386" targetFramework="portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10" />
<package id="Xamarin.Forms" version="1.4.4.6392" targetFramework="portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10" />
</packages>

0 comments on commit ba981df

Please sign in to comment.