Пример #1
0
        public void TestWikiEdit()
        {
            FogBugz     fb = Login();
            WikiArticle wa = fb.ViewArticle(333333);

            wa.Body += " Edit last " + DateTime.Now.ToLongDateString();
            fb.UpdateArticle(wa);
        }
Пример #2
0
        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");
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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"); });
        }
Пример #6
0
        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);
            }
        }
Пример #7
0
        private void GoodLogin()
        {
            FogBugz fb = new FogBugz(_creds.Server);

            fb.LogOn(_creds.UserName, _creds.Password);
        }
Пример #8
0
        private void BadLogin()
        {
            FogBugz fb = new FogBugz("bad url");

            fb.LogOn("bad", "bad");
        }
Пример #9
0
        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;
            }
        }
Пример #10
0
 public FilterDialog(HoverWindow parent, FogBugz fb)
 {
     InitializeComponent();
     _fb = fb;
     _parentWindow = parent;
 }
Пример #11
0
        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;
        }
Пример #12
0
 private void GoodLogin()
 {
     FogBugz fb = new FogBugz(_creds.Server);
     fb.LogOn(_creds.UserName, _creds.Password);
 }
Пример #13
0
 public Importer(XmlDocument mindMap, FogBugz fb)
 {
     _fb = fb;
     _doc = mindMap;
 }
Пример #14
0
 public Exporter(FogBugz fb, Search search)
 {
     _search = search;
     _fb = fb;
 }
Пример #15
0
 public Exporter(FogBugz fb, Search search)
 {
     _search = search;
     _fb     = fb;
 }
Пример #16
0
 public Importer(XmlDocument mindMap, FogBugz fb)
 {
     _fb  = fb;
     _doc = mindMap;
 }
Пример #17
0
 private void BadLogin()
 {
     FogBugz fb = new FogBugz("bad url");
     fb.Logon("bad", "bad");
 }
Пример #18
0
        private void BadLogin()
        {
            var fb = new FogBugz("bad url");

            fb.Logon("bad", "bad");
        }