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;
    }
Esempio n. 2
0
        // GET api/values
        public IEnumerable <AppInfo> Get()
        {
            var apps = DataProvider.GetAllApps();

            return(apps);
        }
Esempio n. 3
0
        public void AllApps()
        {
            var apps = dataProvider.GetAllApps();

            Assert.IsTrue(apps.Count > 0);
        }