Beispiel #1
0
        async Task StartAsync()
        {
            if (MASDevice.Current?.IsRegistered != true)
            {
                _wasLoginRequested = false;

                await MAS.StartAsync();
            }
        }
Beispiel #2
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 #3
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 #4
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 #5
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();
        }