Beispiel #1
0
 static internal void LogError(string message)
 {
     if (MAS.LogLevel == LogLevel.Full || MAS.LogLevel == LogLevel.ErrorOnly)
     {
         MAS.RaiseLogMessage("Error: " + message);
     }
 }
Beispiel #2
0
 static internal void LogInfo(string message)
 {
     if (MAS.LogLevel == LogLevel.Full)
     {
         MAS.RaiseLogMessage("Info: " + message);
     }
 }
Beispiel #3
0
        public async Task TestInvalidConfigContentsStartup()
        {
            await ResetTestAsync();

            await ThrowsAsync(() =>
            {
                return(MAS.StartWithConfigAsync("{{{something something bad JSON").AsTask());
            });
        }
Beispiel #4
0
        public async Task TestEmptyConfigContentsStartup()
        {
            await ResetTestAsync();

            await ThrowsAsync(() =>
            {
                return(MAS.StartWithConfigAsync(string.Empty).AsTask());
            });
        }
Beispiel #5
0
        public async Task TestNullConfigContentsStartup()
        {
            await ResetTestAsync();

            await ThrowsAsync(() =>
            {
                return(MAS.StartWithConfigAsync(null).AsTask());
            });
        }
Beispiel #6
0
        async Task StartAsync()
        {
            if (MASDevice.Current?.IsRegistered != true)
            {
                _wasLoginRequested = false;

                await MAS.StartAsync();
            }
        }
Beispiel #7
0
        public async Task TestClientRegistration()
        {
            await ResetTestAsync();

            MAS.ConfigFileName   = "msso_config.json";
            MAS.RegistrationKind = RegistrationKind.Client;

            await MAS.StartAsync();

            Assert.IsTrue(MASDevice.Current?.IsRegistered == true);
        }
Beispiel #8
0
        public async Task TestMissingConfigFileStartup()
        {
            await ResetTestAsync();

            MAS.ConfigFileName   = "bogus_filepath_msso_config.json";
            MAS.RegistrationKind = RegistrationKind.Client;

            await ThrowsAsync(() =>
            {
                return(MAS.StartAsync().AsTask());
            });
        }
Beispiel #9
0
        public async Task TestMissingPropertyConfigContentsStartup()
        {
            await ResetTestAsync();

            var file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///bogus_msso_config.json"));

            var configText = await Windows.Storage.FileIO.ReadTextAsync(file);

            await ThrowsAsync(() =>
            {
                return(MAS.StartWithConfigAsync(configText).AsTask());
            });
        }
Beispiel #10
0
        public async Task TestConfigContentsStartup()
        {
            await ResetTestAsync();

            MAS.ConfigFileName   = "msso_config.json";
            MAS.RegistrationKind = RegistrationKind.Client;

            var file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///msso_config.json"));

            var configText = await Windows.Storage.FileIO.ReadTextAsync(file);

            await MAS.StartWithConfigAsync(configText);

            Assert.IsTrue(MASDevice.Current?.IsRegistered == true);
        }
Beispiel #11
0
        public async Task TestUserLogin()
        {
            await ResetTestAsync();

            MAS.ConfigFileName   = "msso_config.json";
            MAS.RegistrationKind = RegistrationKind.Client;

            await MAS.StartAsync();

            Assert.IsTrue(MASDevice.Current?.IsRegistered == true);

            await MASUser.LoginAsync("zoljo01", "IdentityMine");

            Assert.IsTrue(MASUser.Current?.IsLoggedIn == true);
        }
Beispiel #12
0
        // This function just tries to clean up any previous registartions for unit testing.
        async Task ResetTestAsync()
        {
            try
            {
                await MAS.StartAsync();

                if (MASDevice.Current?.IsRegistered == true)
                {
                    await MASDevice.Current?.UnregisterAsync();
                }
            }
            catch
            {
            }

            await MAS.ResetAsync();
        }
Beispiel #13
0
        private async void ResetBtn_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            App.IsBusy = true;

            try
            {
                await MAS.ResetAsync();

                ((App)App.Current).NavigateNoRegister();
            }
            catch (Exception exp)
            {
                ErrorText.Text = exp.ToString();
            }

            App.IsBusy = false;
        }
 public void AddAnalysisObject(MainAnalysisObject ma)
 {
     MAS.Add(ma);
 }