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 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(); }