Ejemplo n.º 1
0
        public override bool IsPropertyReadOnly(string propertyName)
        {
            var fullName = TypePrefix + '.' + propertyName;

            try {
                return(EffortTracking.IsEffortTrackingRelated(propertyName) && DataLayer.EffortTracking.AreEffortTrackingPropertiesReadOnly(this));
            } catch (Exception ex) {
                Logger.Warn("Cannot get effort data for " + fullName + " property.", ex);
                return(true);
            }
        }
Ejemplo n.º 2
0
        public void EffortTrackingInit()
        {
            InitEffortExpectations(TrackingLevel.Off, TrackingLevel.On);

            MockRepository.ReplayAll();
            var effortTracking = new EffortTracking(connectorMock);

            effortTracking.Init();
            MockRepository.VerifyAll();

            Assert.IsTrue(effortTracking.TrackEffort);
            Assert.AreEqual(EffortTrackingLevel.PrimaryWorkitem, effortTracking.DefectTrackingLevel);
            Assert.AreEqual(EffortTrackingLevel.SecondaryWorkitem, effortTracking.StoryTrackingLevel);
        }
Ejemplo n.º 3
0
        public void ValidateStoryEffortTrackingProperty()
        {
            var workitem = MockRepository.StrictMock <TestWorkitem>(null, null, null);

            InitEffortExpectations(TrackingLevel.On, TrackingLevel.Off);
            SetupResult.For(workitem.TypePrefix).Return(Entity.StoryType);

            MockRepository.ReplayAll();

            var effortTracking = new EffortTracking(connectorMock);

            effortTracking.Init();
            Assert.IsFalse(effortTracking.AreEffortTrackingPropertiesReadOnly(workitem));

            MockRepository.VerifyAll();
        }
Ejemplo n.º 4
0
        public void RefreshConfig()
        {
            using (MockRepository.Ordered()) {
                InitEffortExpectations(TrackingLevel.Off, TrackingLevel.On);

                Expect.Call(connectorMock.LoadV1Configuration()).Return(configuration);
                Expect.Call(configuration.EffortTracking).Return(false);
                Expect.Call(configuration.StoryTrackingLevel).Return(TrackingLevel.On);
                Expect.Call(configuration.DefectTrackingLevel).Return(TrackingLevel.Off);
            }

            MockRepository.ReplayAll();
            var effortTracking = new EffortTracking(connectorMock);

            effortTracking.Init();
            effortTracking.Refresh();
            MockRepository.VerifyAll();

            Assert.IsFalse(effortTracking.TrackEffort);
            Assert.AreEqual(EffortTrackingLevel.SecondaryWorkitem, effortTracking.DefectTrackingLevel);
            Assert.AreEqual(EffortTrackingLevel.PrimaryWorkitem, effortTracking.StoryTrackingLevel);
        }