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); }
public override void Init(SIEESettings settings) { base.Init(settings); mySettings = settings as SPOSettings; mySettings.InitializeSPOClient(spoClient); spoClient.Login(); }
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); }