public void TestWikiEdit() { FogBugz fb = Login(); WikiArticle wa = fb.ViewArticle(333333); wa.Body += " Edit last " + DateTime.Now.ToLongDateString(); fb.UpdateArticle(wa); }
public void TestMindMapExport() { FogBugz fb = Login(); string query = "project:\"infra\" milestone:\"test\""; Exporter ex = new Exporter(fb, new Search(query, fb.GetCases(query))); ex.CasesToMindMap().Save("output.mm"); }
private FogBugz Login() { FogBugz fb = new FogBugz(_creds.Server); EventWaitHandle evw = new EventWaitHandle(false, EventResetMode.ManualReset); Assert.True(fb.LogOn(_creds.UserName, _creds.Password)); return(fb); }
public void TestModifyParent() { FogBugz fb = Login(); Case[] cases = fb.GetCases("7523"); fb.SetParent(cases[0], 7522); cases = fb.GetCases("7523"); Assert.AreEqual(cases[0].ParentCaseID, 7522); fb.SetParent(cases[0], 7521); cases = fb.GetCases("7523"); Assert.AreEqual(cases[0].ParentCaseID, 7521); }
public void TestEstimate() { FogBugz fb = Login(); Case testCase = fb.GetCases("7523")[0]; fb.SetEstimate(testCase.ID, "1h"); Assert.AreEqual(new TimeSpan(1, 0, 0), fb.GetCases("7523")[0].Estimate); fb.SetEstimate(testCase.ID, "30m"); Assert.AreEqual(new TimeSpan(0, 30, 0), fb.GetCases("7523")[0].Estimate); Assert.Throws(typeof(ECommandFailed), delegate() { fb.SetEstimate(testCase.ID, "$%#$RSD time"); }); }
public void TestMindMapImport() { XmlDocument doc = new XmlDocument(); doc.Load("input.mm"); FogBugz fb = Login(); Importer im = new Importer(doc, fb); ImportAnalysis res = im.Analyze(); Assert.AreEqual(res.CaseToNewParent.Count, 1); // Assert.AreEqual(res.CasesWithNewParents[0].ID, 7164); //Assert.AreEqual(res.CasesWithNewParents[0].ParentCase, 7163); foreach (Case c in res.CaseToNewParent.Keys) { fb.SetParent(c, res.CaseToNewParent[c].ID); } }
private void GoodLogin() { FogBugz fb = new FogBugz(_creds.Server); fb.LogOn(_creds.UserName, _creds.Password); }
private void BadLogin() { FogBugz fb = new FogBugz("bad url"); fb.LogOn("bad", "bad"); }
private void loginWithPrompt(bool forceNewCreds) { Utils.Log.DebugFormat("Logging in to FogBugz (with prompt: {0}", forceNewCreds); try { SetState(new StateLoggingIn(this)); if (forceNewCreds || _password.Length == 0 || _username.Length == 0 || _server.Length == 0 || _server == (string)ConfigurationManager.AppSettings["ExampleServerURL"]) { if (_server.Length == 0) { string url = ConfigurationManager.AppSettings["FogBugzBaseURL"] ?? ""; _server = (url.Length > 0) ? url : (string)ConfigurationManager.AppSettings["ExampleServerURL"]; } LoginResultInfo info = DoLoginScreen(_username, _password, _server); if (info.UserChoice != DialogResult.Cancel) { _username = info.User; _password = info.Password; _server = info.Server; } } Utils.Log.DebugFormat("Server is at {0}", _server); _fb = new FogBugz(_server); LoginAsync(_username, _password, delegate(bool succeeded) { if (succeeded) { saveSettings(); updateCases(); } else { _password = ""; SetState(new StateLoggedOff(this)); MessageBox.Show("Login failed", "FogBugz", MessageBoxButtons.OK, MessageBoxIcon.Error); } }); } catch (Exception x) { SetState(new StateLoggedOff(this)); throw x; } }
public FilterDialog(HoverWindow parent, FogBugz fb) { InitializeComponent(); _fb = fb; _parentWindow = parent; }
private FogBugz Login() { FogBugz fb = new FogBugz(_creds.Server); EventWaitHandle evw = new EventWaitHandle(false, EventResetMode.ManualReset); Assert.True(fb.LogOn(_creds.UserName, _creds.Password)); return fb; }
public Importer(XmlDocument mindMap, FogBugz fb) { _fb = fb; _doc = mindMap; }
public Exporter(FogBugz fb, Search search) { _search = search; _fb = fb; }
private void BadLogin() { FogBugz fb = new FogBugz("bad url"); fb.Logon("bad", "bad"); }
private void BadLogin() { var fb = new FogBugz("bad url"); fb.Logon("bad", "bad"); }