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