Beispiel #1
0
        public void TestReceiveUpdatedChangeListEvent()
        {
            var provider = new TestSourceControlProvider();
            var model    = new ChangesModel(provider);

            var  callCount = 0;
            bool?callValue = null;

            model.BusyStatusUpdated += b =>
            {
                callCount++;
                callValue = b;
            };

            Assert.IsFalse(model.Busy);
            provider.TriggerUpdatedChangeEntries();
            Assert.AreEqual(1, provider.RequestedChangeListCount);
            Assert.IsNotNull(provider.RequestedChangeListCallback);
            Assert.IsTrue(model.Busy);
            Assert.IsTrue(callValue);
            provider.RequestedChangeListCallback.Invoke(new List <IChangeEntry>());
            Assert.IsFalse(model.Busy);
            Assert.IsFalse(callValue);
            Assert.AreEqual(2, callCount);
        }
Beispiel #2
0
        public void TestReceiveUpdatedChangeListEvent()
        {
            var provider = new TestSourceControlProvider();
            var model    = new ChangesModel(provider);

            model.OnStart();

            provider.ChangeList = new List <IChangeEntry> {
                new ChangeEntry("test")
            };

            provider.TriggerUpdatedChangeEntries();
            Assert.AreEqual(2, model.entryData.Count);
        }