public SPOViewModel(SIEESettings settings, ISPOClient spoClient)
        {
            SPOSettings = settings as SPOSettings;
            SPOClient   = spoClient;

            CT = new SPOViewModel_CT(this);
            LT = new SPOViewModel_LT(this);
            FT = new SPOViewModel_FT(this);
            DT = new SPOViewModel_DT(this);

            SelectedTab = 0;
            IsRunning   = false;
            DataLoaded  = false;

            if (SPOSettings.LoginPossible)
            {
                LoginButtonHandler();
            }

            CT.PropertyChanged += (s, e) =>
            {
                if (CT.IsConnectionRelevant(e.PropertyName))
                {
                    SPOSettings.LoginPossible = false;
                    DataLoaded = false;
                    TabNamesReset();
                }
            };
        }
 public void InitializeSPOClient(ISPOClient spoc)
 {
     spoc.SiteUrl  = SiteUrl;
     spoc.Username = Username;
     spoc.SetPassowrd(PasswordEncryption.Decrypt(Password));
     spoc.Office365     = Office365;
     spoc.ClientCulture = new CultureInfo(SelectedCultureInfoName, UseUserOverride);
 }
        private void t01_Login1(SPOTestSystem ts)
        {
            // Confirm regular login
            ISPOClient spoClient = createClient(ts);

            spoClient.Login();

            // Confirm failure with wrong password
            bool gotError = false;

            spoClient.SetPassowrd(ts.Password + "_illegal");
            try { spoClient.Login(); }
            catch { gotError = true; }
            Assert.IsTrue(gotError);
        }
        private void t02_GetLists1(SPOTestSystem ts)
        {
            // Get all lists
            ISPOClient spoClient = createClient(ts);

            spoClient.Login();
            List <SPOList> result = spoClient.GetLists();

            // Verify we've got enough known lists
            Regex regex = new Regex(ts.ListPattern);

            Assert.IsTrue(ts.ListMin <= result.Where(n => regex.Match(n.Title).Success).Count());

            // Verify we've got several base types and template types
            Assert.IsTrue(0 < result.Select(n => n.BaseType).Distinct().Count());
            Assert.IsTrue(0 < result.Select(n => n.TemplateType).Distinct().Count());
        }
        private void t04_GetFields1(SPOTestSystem ts)
        {
            ISPOClient spoClient = createClient(ts);

            spoClient.Login();

            // Ensure there is a minimum number of field returned for our test library
            SPOList         testLibrary = ((SPOClient)spoClient).GetListByTitle(ts.TestLibrary);
            List <SPOField> result      = spoClient.GetFields(testLibrary);

            Assert.IsTrue(ts.FieldMin <= result.Count);
            Assert.AreEqual(1, result.Where(n => n.Title == "Title").Count());

            // Ensure the forcedField parameter worlds; "Title" should not matter.
            int cnt = result.Count;

            result = spoClient.GetFields(testLibrary, new List <string>()
            {
                "Name", "Title"
            });
            Assert.AreEqual(cnt + 1, result.Count);
        }
Beispiel #6
0
 public SPOExport(ISPOClient spoClient)
 {
     this.spoClient = spoClient;
 }