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; } }
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(); }
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(); }
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); }
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")); }
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(); }
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("")); }
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); }
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); }
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()); }
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); }
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); }
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))); }
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()); }
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); }
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(); }
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); }
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)); }
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()); }
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); }
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); }
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()); }