Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created SmokeTest projects. #3450

Merged
merged 19 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,20 @@
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
</Target>

<!--
Required workaround for ProjectReference inclusion of the Controls package
The UWP project system is including the Controls resources in the pri file because
it doesn't know it'll be an independent package later during packing.
Therefore, we need to remove these extra resources in the PRI pipeline so the
Markdown pri file is properly generated and doesn't include duplicate references to Control resources.
-->
<Target Name="RemoveUnwantedPri" AfterTargets="GetPackagingOutputs">
<!--<Message Text="Files Before: @(PackagingOutputs)" Importance="high" />-->
<ItemGroup>
<PackagingOutputs Remove="@(PackagingOutputs)" Condition="'%(PackagingOutputs.Filename)%(PackagingOutputs.Extension)' == 'Microsoft.Toolkit.Uwp.UI.Controls.pri'" />
<PackagingOutputs Remove="@(PackagingOutputs)" Condition="$([System.String]::new('%(PackagingOutputs.TargetPath)').StartsWith('Microsoft.Toolkit.Uwp.UI.Controls\'))" />
</ItemGroup>
<!--<Message Text="Files After: @(PackagingOutputs)" Importance="high" />-->
</Target>
</Project>
7 changes: 7 additions & 0 deletions SmokeTests/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Application
x:Class="SmokeTest.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SmokeTest">

</Application>
106 changes: 106 additions & 0 deletions SmokeTests/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

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 SmokeTest
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public 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>
private 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();
}
}
}
Binary file added SmokeTests/Assets/LockScreenLogo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmokeTests/Assets/SplashScreen.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmokeTests/Assets/Square150x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmokeTests/Assets/Square44x44Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmokeTests/Assets/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SmokeTests/Assets/Wide310x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions SmokeTests/Microsoft.Toolkit.HighPerformance/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Page
x:Class="SmokeTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SmokeTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="300">
<Button Content="Click" Click="Button_Click" HorizontalAlignment="Center"/>
<TextBlock x:Name="textBlock" HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
</Page>
23 changes: 23 additions & 0 deletions SmokeTests/Microsoft.Toolkit.HighPerformance/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.Toolkit.HighPerformance.Helpers;

namespace SmokeTest
{
public sealed partial class MainPage
{
public MainPage()
{
InitializeComponent();
}

private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
const uint value = 0xAAAA5555u;

textBlock.Text = BitHelper.HasLookupFlag(value, 0).ToString();
}
}
}
17 changes: 17 additions & 0 deletions SmokeTests/Microsoft.Toolkit.Mvvm/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Page
x:Class="SmokeTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SmokeTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="200">
<Button Content="Click" Command="{x:Bind TestCommand}" HorizontalAlignment="Center"/>
<TextBlock x:Name="textBlock"/>
</StackPanel>
</Grid>
</Page>
25 changes: 25 additions & 0 deletions SmokeTests/Microsoft.Toolkit.Mvvm/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.Toolkit.Mvvm.Input;

namespace SmokeTest
{
public sealed partial class MainPage
{
public RelayCommand TestCommand { get; }

public MainPage()
{
TestCommand = new RelayCommand(ExecuteRelayCommand);

InitializeComponent();
}

private void ExecuteRelayCommand()
{
textBlock.Text = "Clicked";
}
}
}
25 changes: 25 additions & 0 deletions SmokeTests/Microsoft.Toolkit.Parsers/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Page
x:Class="SmokeTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SmokeTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<ScrollViewer>
<StackPanel Padding="12">
<TextBox x:Name="RawMarkdown"
Header="Markdown"
Text="This is **Markdown**"
TextChanged="RawMarkdown_TextChanged"
AcceptsReturn="True"
MinHeight="60" />
<TextBlock
Text="Result:"
Margin="0,10,0,0" />
<TextBlock x:Name="MarkdownResult" />
</StackPanel>
</ScrollViewer>
</Page>
37 changes: 37 additions & 0 deletions SmokeTests/Microsoft.Toolkit.Parsers/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.Toolkit.Parsers.Markdown;
using Windows.UI.Xaml.Controls;

namespace SmokeTest
{
public sealed partial class MainPage
{
public MainPage()
{
InitializeComponent();

Loaded += MarkdownParserPage_Loaded;
}

private void MarkdownParserPage_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
UpdateMDResult();
}

private void RawMarkdown_TextChanged(object sender, TextChangedEventArgs e)
{
UpdateMDResult();
}

private void UpdateMDResult()
{
var document = new MarkdownDocument();
document.Parse(RawMarkdown.Text);

MarkdownResult.Text = $"Root type is: {document.Type.ToString()}";
}
}
}
21 changes: 21 additions & 0 deletions SmokeTests/Microsoft.Toolkit.Services/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Page
x:Class="SmokeTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SmokeTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="300">
<Button x:Name="ConnectButton"
Margin="0,10,0,0"
VerticalAlignment="Bottom"
Click="ConnectButton_OnClick"
Content="Connect" />
<TextBlock x:Name="textBlock"/>
</StackPanel>
</Grid>
</Page>
29 changes: 29 additions & 0 deletions SmokeTests/Microsoft.Toolkit.Services/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.Toolkit.Services.Twitter;

namespace SmokeTest
{
public sealed partial class MainPage
{
public MainPage()
{
InitializeComponent();
}

private void ConnectButton_OnClick(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
try
{
TwitterService.Instance.Initialize(string.Empty, string.Empty, string.Empty);
}
catch (Exception ex)
{
textBlock.Text = ex.ToString();
}
}
}
}
17 changes: 17 additions & 0 deletions SmokeTests/Microsoft.Toolkit.Uwp.Connectivity/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Page
x:Class="SmokeTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SmokeTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Width="200">
<Button Content="Click" Click="Button_Click" HorizontalAlignment="Center"/>
<TextBlock x:Name="textBlock" HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
</Page>
21 changes: 21 additions & 0 deletions SmokeTests/Microsoft.Toolkit.Uwp.Connectivity/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.Toolkit.Uwp.Connectivity;

namespace SmokeTest
{
public sealed partial class MainPage
{
public MainPage()
{
InitializeComponent();
}

private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
textBlock.Text = NetworkHelper.Instance.ConnectionInformation.IsInternetAvailable.ToString();
}
}
}
Loading