public void AppsByType() { var typesToTest = new string[] { "Web", "Mobile", "desktop" }; var enc = new StringUtilities(EncodingFormats.Base64); var allApps = dataProvider.GetAllApps(); foreach (var appType in typesToTest) { var encodedType = enc.EncodeString(appType); var apps = dataProvider.GetAppsByType(encodedType); var appsOfType = allApps.Where(a => a.AppType.Equals(appType, StringComparison.OrdinalIgnoreCase)).ToList(); Assert.AreEqual(appsOfType.Count, apps.Count); } }
private void RunTests_Click(object sender, RoutedEventArgs e) { var typesToTest = new string[] { "Web", "Mobile", "desktop" }; AppDataProvider dataProvider = new AppDataProvider(DataRootPath); var enc = new StringUtilities(EncodingFormats.Base64); var allApps = dataProvider.GetAllApps(); var results = new List <TestResult>(); var cert = Certificate.GenerateNewCertificate(); foreach (var appType in typesToTest) { var encodedType = enc.EncodeString(appType, cert); var apps = dataProvider.GetAppsByType(encodedType); var appsOfType = allApps.Where(a => a.AppType.Equals(appType, StringComparison.OrdinalIgnoreCase)).ToList(); var result = new TestResult(appType, apps.Count == appsOfType.Count); results.Add(result); } ViewModel.TestResults = results; ViewModel.Mode = ViewModelMode.TestResults; }
// GET api/values/5 public IEnumerable <AppInfo> Get(string encodedType) { var apps = DataProvider.GetAppsByType(encodedType); return(apps); }