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);
        }
        public void ValidateDefectEffortTrackingPropertyReadOnly() {
            var workitem = MockRepository.StrictMock<TestWorkitem>(null, null, null);

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

            MockRepository.ReplayAll();

            var effortTracking = new EffortTracking(connectorMock);
            effortTracking.Init();
            Assert.IsTrue(effortTracking.AreEffortTrackingPropertiesReadOnly(workitem));

            MockRepository.VerifyAll();
        }
        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);
        }