Пример #1
0
        public void TestHavingConflictsDisablesPublish()
        {
            m_Model.ToggledEntries = new List <IChangeEntryData>()
            {
                new TestChangesModel.ChangeEntryData
                {
                    Entry = new ChangeEntry("path", null, ChangeEntryStatus.Modified)
                }
            };
            // Base case
            m_Presenter.Start();
            m_Model.ConflictedEntries = new List <IChangeEntryData>();
            m_Model.TriggerUpdatedChangeList();
            Assert.AreEqual(1, m_View.SetPublishEnabledCount);
            Assert.AreEqual(true, m_View.SetPublishEnabledValue);

            // Disable
            m_Model.ConflictedEntries = new List <IChangeEntryData>
            {
                new TestChangesModel.ChangeEntryData
                {
                    Conflicted = true,
                    Entry      = new ChangeEntry("path", null, ChangeEntryStatus.Unmerged, false, true)
                }
            };
            m_Model.TriggerUpdatedChangeList();
            Assert.AreEqual(2, m_View.SetPublishEnabledCount);
            Assert.AreEqual(false, m_View.SetPublishEnabledValue);
            Assert.IsNotNull(m_View.SetPublishEnabledReason);

            // Re enabled
            m_Model.ConflictedEntries = new List <IChangeEntryData>();
            m_Model.TriggerUpdatedChangeList();
            Assert.AreEqual(3, m_View.SetPublishEnabledCount);
            Assert.AreEqual(true, m_View.SetPublishEnabledValue);
        }
Пример #2
0
 public void TestToggledCountValue()
 {
     m_Presenter.Start();
     m_Model.ToggledEntries = new List <IChangeEntryData>
     {
         new TestChangesModel.ChangeEntryData {
             Toggled = true, Entry = new ChangeEntry("path")
         },
         new TestChangesModel.ChangeEntryData {
             Toggled = true, Entry = new ChangeEntry("path2")
         }
     };
     Assert.AreEqual(2, m_Presenter.ToggledCount);
 }