static internal void LogError(string message) { if (MAS.LogLevel == LogLevel.Full || MAS.LogLevel == LogLevel.ErrorOnly) { MAS.RaiseLogMessage("Error: " + message); } }
static internal void LogInfo(string message) { if (MAS.LogLevel == LogLevel.Full) { MAS.RaiseLogMessage("Info: " + message); } }
public async Task TestInvalidConfigContentsStartup() { await ResetTestAsync(); await ThrowsAsync(() => { return(MAS.StartWithConfigAsync("{{{something something bad JSON").AsTask()); }); }
public async Task TestEmptyConfigContentsStartup() { await ResetTestAsync(); await ThrowsAsync(() => { return(MAS.StartWithConfigAsync(string.Empty).AsTask()); }); }
public async Task TestNullConfigContentsStartup() { await ResetTestAsync(); await ThrowsAsync(() => { return(MAS.StartWithConfigAsync(null).AsTask()); }); }
async Task StartAsync() { if (MASDevice.Current?.IsRegistered != true) { _wasLoginRequested = false; await MAS.StartAsync(); } }
public async Task TestClientRegistration() { await ResetTestAsync(); MAS.ConfigFileName = "msso_config.json"; MAS.RegistrationKind = RegistrationKind.Client; await MAS.StartAsync(); Assert.IsTrue(MASDevice.Current?.IsRegistered == true); }
public async Task TestMissingConfigFileStartup() { await ResetTestAsync(); MAS.ConfigFileName = "bogus_filepath_msso_config.json"; MAS.RegistrationKind = RegistrationKind.Client; await ThrowsAsync(() => { return(MAS.StartAsync().AsTask()); }); }
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()); }); }
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); }
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); }
// 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(); }
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); }