SelectProject() public method

Set the value of the project
public SelectProject ( object projectId ) : bool
projectId object
return bool
コード例 #1
0
        private void OnProjectSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count <= 0)
            {
                return;
            }
            string item = (e.AddedItems[0] as KeyValuePair).Value;

            try
            {
                Cursor = Cursors.Wait;

                if (!Model.SelectProject(item))
                {
                    return;
                }

                BindCardTypes();
                BindExplorerTrees();

                if (null != _murmurs)
                {
                    _murmurs.Control.RefreshMurmurs();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, VisualStudio.Resources.MingleExtensionTitle);
            }
            finally
            {
                Cursor = Cursors.Arrow;
            }
        }
コード例 #2
0
 public void TestCardDescription()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var card = model.GetOneCard(126);
     Assert.AreEqual("ready to test", card.Description);
     card.AddCardAttributeFilterToPostData("description", "xxx");
     card.Update();
     var card2 = model.GetOneCard(126);
     Assert.AreEqual("xxx", card2.Description);
     card.AddCardAttributeFilterToPostData("description", "ready to test");
     card.Update();
 }
コード例 #3
0
        internal void Initialize(ViewModel model)
        {
            Model = model;

            CheckSettings();

            murmursList.ItemsSource = Model.Murmurs;

            if (string.IsNullOrEmpty(MingleSettings.Project))
            {
                MessageBox.Show("Please open Mingle Explorer and select a project before opening the murmurs window.");
                return;
            }

            Model.SelectProject(MingleSettings.Project);

            RefreshMurmurs();
        }
コード例 #4
0
        internal void Initialize(ViewModel model)
        {
            Model = model;

            CheckSettings();

            murmursList.ItemsSource = Model.Murmurs;

            if (string.IsNullOrEmpty(MingleSettings.Project))
            {
                MessageBox.Show("Please open Mingle Explorer and select a project before opening the murmurs window.");
                return;
            }

            Model.SelectProject(MingleSettings.Project);

            RefreshMurmurs();
        }
コード例 #5
0
 public void TestTeamMembersAsManagedList()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var team = model.TeamMemberDictionaryAsManagedList;
     Assert.IsInstanceOfType(team, typeof(TeamMemberDictionary));
     Assert.IsInstanceOfType(team["mingleuser"], typeof(TeamMember));
     Assert.AreEqual(true, team.ContainsKey("mingleuser"));
     Assert.IsFalse(team.Values[0].IsSet);
     Assert.AreEqual("(not set)", team.Values[0].Name);
     Assert.AreEqual("(not set)", team.Values[0].Login);
 }
コード例 #6
0
 public void TestTeamMembers()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var team = model.TeamMemberDictionary;
     Assert.IsInstanceOfType(team, typeof(TeamMemberDictionary));
     Assert.IsInstanceOfType(team["mingleuser"], typeof(TeamMember));
     Assert.AreEqual(true, team.ContainsKey("mingleuser"));
 }
コード例 #7
0
 public void TestSetPropertyValue()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var card = model.GetOneCard(120);
     var p = card.Properties;
     card.SetPropertyOrAttributValue("description", "the quick brown fox jumped over the wall");
     card.SetPropertyOrAttributValue("Owner", "mark");
     card.Update();
     card = model.GetOneCard(120);
     Assert.AreEqual("the quick brown fox jumped over the wall", card.Description);
     Assert.AreEqual("mark", card.Properties["Owner"].Value);
     // Reset the data
     card.SetPropertyOrAttributValue("description", string.Empty);
     card.SetPropertyOrAttributValue("Owner", string.Empty);
     card.Update();
 }
コード例 #8
0
 public void TestSelectProject()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     Assert.AreEqual(true, model.SelectProject("test"));
     Assert.AreEqual(false, model.SelectProject(""));
 }
コード例 #9
0
 public void TestPropertyDefinitionsRefresh()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var p = model.PropertyDefinitions;
     Assert.IsInstanceOfType(p, typeof(Dictionary<string, CardProperty>));
     Assert.AreEqual(false, p["Priority"].IsNumeric);
     Assert.AreEqual("cp_priority", p["Priority"].ColumnName);
 }
コード例 #10
0
 public void TestCardTypesRefresh()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var target = model.CardTypesDictionary;
     var actual = target.Count;
     const int expected = 7;
     Assert.AreEqual(expected, actual);
 }
コード例 #11
0
 public void TransitionsIntegrationTest()
 {
     Assert.AreEqual(19, new MingleServer(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD).GetProject("test").Transitions.Count);
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     Assert.AreEqual(1, model.GetOneCard(126).Transitions.Count());
 }
コード例 #12
0
 public void TestGetOneCard()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var card = model.GetOneCard(120);
     Assert.AreEqual("This is a card for testing", card.Name);
 }
コード例 #13
0
 public void TestGetCardsOfType()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var count = model.GetCardsOfType("Feature").Count;
     Assert.AreEqual(10, count);
 }
コード例 #14
0
 public void TestGetMurmurs()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var m = model.Murmurs;
     Assert.IsInstanceOfType(m, typeof(IEnumerable<Murmur>));
     Assert.AreNotEqual(0, m.Count());
     m.ToList().ForEach(murmur => Assert.IsFalse(string.IsNullOrEmpty(murmur.Name)));
 }
コード例 #15
0
 public void TestGetCardsForFavorite()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var earlier = DateTime.Now;
     var cardList = model.GetCardsForFavorite("Risks");
     var later = DateTime.Now;
     var span = later.Subtract(earlier);
     Assert.AreEqual(5, cardList.Count);
     if (span.Seconds > 10) Assert.Fail("GetCardsForFavorite is too slow: " + span.Duration());
 }
コード例 #16
0
        public void TestGetCardProperties()
        {
            var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
            model.SelectProject("test");
            var card = model.GetOneCard(92);
            Assert.IsInstanceOfType(card, typeof(Card));
            var p = card.Properties["Priority"] as CardProperty;
            Assert.AreEqual("Essential", p.Value);
            Assert.AreEqual("managed text list", p.PropertyValuesDescription.ToLower());
            Assert.AreEqual(false, p.Hidden);
            Assert.AreEqual(5, p.PropertyValueDetails.Count);
            Assert.AreEqual("(not set)", p.PropertyValueDetails[0]);
            Assert.AreEqual("Critical", p.PropertyValueDetails[1]);
            Assert.AreEqual("Essential", p.PropertyValueDetails[2]);
            Assert.AreEqual("Non-Essential", p.PropertyValueDetails[3]);
            Assert.AreEqual("Nice to have", p.PropertyValueDetails[4]);
            try
            {
                Assert.AreEqual("Nice to have", p.PropertyValueDetails[4]);
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(ex, typeof(ArgumentOutOfRangeException));
            }

            p = card.Properties["Added to Scope On"] as CardProperty;
            Assert.AreEqual("2008-01-02", p.Value);
            Assert.AreEqual(true, p.Hidden);

            p = card.Properties["Analysis Completed in Iteration"] as CardProperty;
            Assert.AreEqual(false, p.Hidden);
            Assert.AreEqual("35", p.Value);
            model.SelectProject("test");
            Assert.AreEqual("Iteration 2", model.GetOneCard(35).Name);
        }
コード例 #17
0
 public void TestCardValuedPropertyNotSet()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var card = model.GetOneCard(36);
     var p = card.Properties;
     card.SetPropertyOrAttributValue("Release", "32");
     card.Update();
 }
コード例 #18
0
 public void TestTransitionDataDependencies()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     //var transition = model.GetOneCard(61).Transitions
     //var stackFrame = model.GetStackPanelOfTransitionDependencies(transition);
 }
コード例 #19
0
 public void TestIntegrationCardCreate()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var card = model.CreateCard("Iteration", "test");
     Assert.IsInstanceOfType(card, typeof(Card));
 }
コード例 #20
0
 public void TestCardList()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var list = model.GetCardList(new Collection<string> {"Release", "Feature"});
     Assert.AreEqual(13, list.Count());
 }
コード例 #21
0
 public void TestIsManagedListOfScalars()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var card = model.GetOneCard(120);
     var p = card.Properties["Story Status"];
     Assert.IsTrue(p.IsManagedListOfScalars);
     p = card.Properties["Release"];
     Assert.IsFalse(p.IsManagedListOfScalars);
     p = card.Properties["Owner"];
     Assert.IsFalse(p.IsManagedListOfScalars);
 }
コード例 #22
0
 public void TestGetPropertyScalarValue()
 {
     //var model = new ViewModel("card_property.xml");
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     var card = model.GetOneCard(92);
     Assert.IsInstanceOfType(card, typeof(Card));
     Assert.AreEqual("Essential", card.Properties["Priority"].Value);
 }
コード例 #23
0
 public void TestCardTransitions()
 {
     var model = new ViewModel(_mingleHost, MINGLE_INTEGRATION_USER, MINGLE_INTEGRATION_PASSWORD);
     model.SelectProject("test");
     // Touch the Transitions property to populate the cache
     var transitions = model.GetOneCard(7).Transitions.ToList();
     Assert.AreNotEqual(null, transitions);
     Assert.AreEqual(3, transitions.Count());
 }