public void RebuildEventShouldGetRaisedWhenRebuildWasRequested() { AppInfo anyApp = AppBuilderTestExtensions.GetMockAppInfo("TestApp", PlatformName.Windows); appListViewModel.RebuildRequest += (appInfo) => AssertBuiltApp(anyApp, appInfo); appListViewModel.RequestRebuild(anyApp); }
private static BuiltAppsListViewModel GetBuiltAppsListWithDummyEntry() { var listViewModel = new BuiltAppsListViewModel(new MockSettings()); listViewModel.AddApp(AppBuilderTestExtensions.GetMockAppInfo("Windows app", PlatformName.Windows)); return(listViewModel); }
private void AddMockAppInfoAndSaveWithDummyData(string appName) { string folder = appListViewModel.AppStorageDirectory; appListViewModel.AddApp( AppBuilderTestExtensions.GetMockAppInfo(appName, PlatformName.Windows, folder), new byte[] { 1 }); }
public void AddValidBuiltApp() { int builtApps = 0; appListViewModel.NumberOfBuiltAppsChanged += () => builtApps = appListViewModel.NumberOfBuiltApps; appListViewModel.AddApp(AppBuilderTestExtensions.GetMockAppInfo("AppNotSavedOnDisk", PlatformName.Windows)); Assert.AreEqual(builtApps, appListViewModel.NumberOfBuiltApps); }
private static BuiltAppsListViewModel CreateAppsListViewModelWithDummyEntries() { var appListViewModel = new BuiltAppsListViewModel(new MockSettings()); appListViewModel.AddApp(AppBuilderTestExtensions.GetMockAppInfo("A Windows app", PlatformName.Windows)); appListViewModel.AddApp(AppBuilderTestExtensions.GetMockAppInfo("A Windows Phone 7 app", PlatformName.WindowsPhone7)); return(appListViewModel); }
public void ShowViewWithSeveralAppEntries() { BuiltAppsListViewModel list = GetBuiltAppsListWithDummyEntry(); list.AddApp(AppBuilderTestExtensions.GetMockAppInfo("Windows app", PlatformName.Windows)); list.AddApp(AppBuilderTestExtensions.GetMockAppInfo("Android app", PlatformName.Android)); list.AddApp(AppBuilderTestExtensions.GetMockAppInfo("Web app", PlatformName.Web)); var window = CreateVerifiableWindowFromViewModel(list); window.ShowDialog(); }
public void ShowViewWithMockServiceAndDummyApps() { AppBuilderView builderView = CreateViewAndViewModelViaMockService(); AppBuilderViewModel viewModel = builderView.ViewModel; viewModel.AppListViewModel.AddApp( AppBuilderTestExtensions.GetMockAppInfo("My favorite app", PlatformName.Windows)); viewModel.AppListViewModel.AddApp(AppBuilderTestExtensions.GetMockAppInfo( "My mobile app", PlatformName.Android)); viewModel.AppListViewModel.AddApp(AppBuilderTestExtensions.GetMockAppInfo( "My cool web app", PlatformName.Web)); WpfWindow window = CreateTestWindow(builderView); window.ShowDialog(); }
public void ShowIconOfOfficialSupportedPlatforms() { BuiltAppsListViewModel list = GetBuiltAppsListWithDummyEntry(); IEnumerable <PlatformName> allPlatforms = EnumExtensions.GetEnumValues <PlatformName>(); foreach (PlatformName platform in allPlatforms) { if (platform != PlatformName.WindowsPhone7) { list.AddApp(AppBuilderTestExtensions.GetMockAppInfo(platform + " app", platform)); } } var window = CreateVerifiableWindowFromViewModel(list); window.ShowDialog(); }
private static AppInfo GetMockAppInfo(string appName, PlatformName platform = PlatformName.Windows) { return(AppBuilderTestExtensions.GetMockAppInfo(appName, platform)); }