diff --git a/Samples/.gitignore b/Samples/.gitignore new file mode 100644 index 00000000..761d8c30 --- /dev/null +++ b/Samples/.gitignore @@ -0,0 +1,2 @@ +project.lock.json +*.user \ No newline at end of file diff --git a/Samples/BaseConverterTest/BaseConverterTest.sln b/Samples/BaseConverterTest/BaseConverterTest.sln new file mode 100644 index 00000000..a63bb4f7 --- /dev/null +++ b/Samples/BaseConverterTest/BaseConverterTest.sln @@ -0,0 +1,62 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseConverterUWP", "BaseConverterUWP\BaseConverterUWP.csproj", "{8465E874-BFC7-4B8A-B9BB-E710DB67F520}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseConverterUITest", "BaseConverterUITest\BaseConverterUITest.csproj", "{8D72292F-6450-4AEE-91B5-4C34A225C9CE}" +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 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|Any CPU.ActiveCfg = Debug|x86 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|ARM.ActiveCfg = Debug|ARM + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|ARM.Build.0 = Debug|ARM + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|ARM.Deploy.0 = Debug|ARM + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x64.ActiveCfg = Debug|x64 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x64.Build.0 = Debug|x64 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x64.Deploy.0 = Debug|x64 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x86.ActiveCfg = Debug|x86 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x86.Build.0 = Debug|x86 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Debug|x86.Deploy.0 = Debug|x86 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|Any CPU.ActiveCfg = Release|x86 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|ARM.ActiveCfg = Release|ARM + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|ARM.Build.0 = Release|ARM + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|ARM.Deploy.0 = Release|ARM + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x64.ActiveCfg = Release|x64 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x64.Build.0 = Release|x64 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x64.Deploy.0 = Release|x64 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x86.ActiveCfg = Release|x86 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x86.Build.0 = Release|x86 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520}.Release|x86.Deploy.0 = Release|x86 + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|ARM.ActiveCfg = Debug|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|ARM.Build.0 = Debug|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|x64.ActiveCfg = Debug|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|x64.Build.0 = Debug|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|x86.ActiveCfg = Debug|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Debug|x86.Build.0 = Debug|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|Any CPU.Build.0 = Release|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|ARM.ActiveCfg = Release|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|ARM.Build.0 = Release|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|x64.ActiveCfg = Release|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|x64.Build.0 = Release|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|x86.ActiveCfg = Release|Any CPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Samples/BaseConverterTest/BaseConverterUITest/BaseConverterUITest.csproj b/Samples/BaseConverterTest/BaseConverterUITest/BaseConverterUITest.csproj new file mode 100644 index 00000000..2f84b3a8 --- /dev/null +++ b/Samples/BaseConverterTest/BaseConverterUITest/BaseConverterUITest.csproj @@ -0,0 +1,91 @@ + + + + Debug + AnyCPU + {8D72292F-6450-4AEE-91B5-4C34A225C9CE} + Library + Properties + BaseConverterUITest + BaseConverterUITest + v4.5.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + ..\packages\Selenium.WebDriver.2.53.0\lib\net40\WebDriver.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + + \ No newline at end of file diff --git a/Samples/BaseConverterTest/BaseConverterUITest/Properties/AssemblyInfo.cs b/Samples/BaseConverterTest/BaseConverterUITest/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..da7bab74 --- /dev/null +++ b/Samples/BaseConverterTest/BaseConverterUITest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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("BaseConverterUITest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("BaseConverterUITest")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[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)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8d72292f-6450-4aee-91b5-4c34a225c9ce")] + +// 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")] diff --git a/Samples/BaseConverterTest/BaseConverterUITest/UnitTest1.cs b/Samples/BaseConverterTest/BaseConverterUITest/UnitTest1.cs new file mode 100644 index 00000000..86a716ac --- /dev/null +++ b/Samples/BaseConverterTest/BaseConverterUITest/UnitTest1.cs @@ -0,0 +1,71 @@ +//****************************************************************************** +// +// Copyright (c) 2016 Microsoft Corporation. All rights reserved. +// +// This code is licensed under the MIT License (MIT). +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +//****************************************************************************** + +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using OpenQA.Selenium.Remote; + +namespace BaseConverterUITest +{ + [TestClass] + public class UnitTest1 + { + protected const string AppDriverUrl = "http://127.0.0.1:4723"; + protected static RemoteWebDriver TestAppSession; + protected static RemoteWebElement TestAppResult; + + [ClassInitialize] + public static void Setup(TestContext context) + { + DesiredCapabilities appCapabilities = new DesiredCapabilities(); + appCapabilities.SetCapability("app", "67017b09-d193-4676-a8a5-9d474e2f2c74_1gb0zh1xa1sqe!App"); + TestAppSession = new RemoteWebDriver(new Uri(AppDriverUrl), appCapabilities); + + Assert.IsNotNull(TestAppSession); + } + [TestMethod] + public void ConvertBaseTest() + { + var boxes = TestAppSession.FindElementsByClassName("TextBox"); + for (int i = 0; i < boxes.Count; i++) + { + var item = boxes[i]; + if (i == 0) + { + item.SendKeys("16"); + } + else if (i == 1) + { + item.SendKeys("2"); + } + else + { + //do nothing + } + } + + var button = TestAppSession.FindElementByClassName("Button"); + button.Click(); + + /*Verify the conversion happened successfully by locating the converted item on the page + *In this case, converting 16 from base 10 to base 2 should yield 10,000 as the result*/ + TestAppResult = TestAppSession.FindElementByName("10000") as RemoteWebElement; + Assert.IsNotNull(TestAppResult); + + TestAppSession.Dispose(); + } + } +} diff --git a/Samples/BaseConverterTest/BaseConverterUITest/packages.config b/Samples/BaseConverterTest/BaseConverterUITest/packages.config new file mode 100644 index 00000000..86b5f26f --- /dev/null +++ b/Samples/BaseConverterTest/BaseConverterUITest/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Samples/BaseConverterTest/BaseConverterUWP/App.xaml b/Samples/BaseConverterTest/BaseConverterUWP/App.xaml new file mode 100644 index 00000000..693f6c6d --- /dev/null +++ b/Samples/BaseConverterTest/BaseConverterUWP/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/Samples/BaseConverterTest/BaseConverterUWP/App.xaml.cs b/Samples/BaseConverterTest/BaseConverterUWP/App.xaml.cs new file mode 100644 index 00000000..d2a505d6 --- /dev/null +++ b/Samples/BaseConverterTest/BaseConverterUWP/App.xaml.cs @@ -0,0 +1,121 @@ +//****************************************************************************** +// +// Copyright (c) 2016 Microsoft Corporation. All rights reserved. +// +// This code is licensed under the MIT License (MIT). +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +//****************************************************************************** + +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 BaseConverterUWP +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + sealed partial class App : Application + { + /// + /// 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(). + /// + public App() + { + this.InitializeComponent(); + this.Suspending += OnSuspending; + } + + /// + /// 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. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs e) + { + +#if DEBUG + if (System.Diagnostics.Debugger.IsAttached) + { + this.DebugSettings.EnableFrameRateCounter = true; + } +#endif + + 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 (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(BaseConverterUWP.MainPage), e.Arguments); + } + // Ensure the current window is active + Window.Current.Activate(); + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + + /// + /// 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. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + //TODO: Save application state and stop any background activity + deferral.Complete(); + } + } +} diff --git a/Samples/BaseConverterTest/BaseConverterUWP/Assets/LockScreenLogo.scale-200.png b/Samples/BaseConverterTest/BaseConverterUWP/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 00000000..735f57ad Binary files /dev/null and b/Samples/BaseConverterTest/BaseConverterUWP/Assets/LockScreenLogo.scale-200.png differ diff --git a/Samples/BaseConverterTest/BaseConverterUWP/Assets/SplashScreen.scale-200.png b/Samples/BaseConverterTest/BaseConverterUWP/Assets/SplashScreen.scale-200.png new file mode 100644 index 00000000..023e7f1f Binary files /dev/null and b/Samples/BaseConverterTest/BaseConverterUWP/Assets/SplashScreen.scale-200.png differ diff --git a/Samples/BaseConverterTest/BaseConverterUWP/Assets/Square150x150Logo.scale-200.png b/Samples/BaseConverterTest/BaseConverterUWP/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 00000000..af49fec1 Binary files /dev/null and b/Samples/BaseConverterTest/BaseConverterUWP/Assets/Square150x150Logo.scale-200.png differ diff --git a/Samples/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.scale-200.png b/Samples/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 00000000..ce342a2e Binary files /dev/null and b/Samples/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.scale-200.png differ diff --git a/Samples/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Samples/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 00000000..f6c02ce9 Binary files /dev/null and b/Samples/BaseConverterTest/BaseConverterUWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/Samples/BaseConverterTest/BaseConverterUWP/Assets/StoreLogo.png b/Samples/BaseConverterTest/BaseConverterUWP/Assets/StoreLogo.png new file mode 100644 index 00000000..7385b56c Binary files /dev/null and b/Samples/BaseConverterTest/BaseConverterUWP/Assets/StoreLogo.png differ diff --git a/Samples/BaseConverterTest/BaseConverterUWP/Assets/Wide310x150Logo.scale-200.png b/Samples/BaseConverterTest/BaseConverterUWP/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 00000000..288995b3 Binary files /dev/null and b/Samples/BaseConverterTest/BaseConverterUWP/Assets/Wide310x150Logo.scale-200.png differ diff --git a/Samples/BaseConverterTest/BaseConverterUWP/BaseConverterUWP.csproj b/Samples/BaseConverterTest/BaseConverterUWP/BaseConverterUWP.csproj new file mode 100644 index 00000000..c2dd3eb6 --- /dev/null +++ b/Samples/BaseConverterTest/BaseConverterUWP/BaseConverterUWP.csproj @@ -0,0 +1,141 @@ + + + + + Debug + x86 + {8465E874-BFC7-4B8A-B9BB-E710DB67F520} + AppContainerExe + Properties + BaseConverterUWP + BaseConverterUWP + en-US + UAP + 10.0.10586.0 + 10.0.10240.0 + 14 + true + 512 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + BaseConverter_TemporaryKey.pfx + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM + false + prompt + true + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x64 + false + prompt + true + true + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x86 + false + prompt + true + + + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x86 + false + prompt + true + true + + + + + + + + App.xaml + + + MainPage.xaml + + + + + + Designer + + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + 14.0 + + + + \ No newline at end of file diff --git a/Samples/BaseConverterTest/BaseConverterUWP/BaseConverter_TemporaryKey.pfx b/Samples/BaseConverterTest/BaseConverterUWP/BaseConverter_TemporaryKey.pfx new file mode 100644 index 00000000..b5ae9576 Binary files /dev/null and b/Samples/BaseConverterTest/BaseConverterUWP/BaseConverter_TemporaryKey.pfx differ diff --git a/Samples/BaseConverterTest/BaseConverterUWP/MainPage.xaml b/Samples/BaseConverterTest/BaseConverterUWP/MainPage.xaml new file mode 100644 index 00000000..13a3319b --- /dev/null +++ b/Samples/BaseConverterTest/BaseConverterUWP/MainPage.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + +