Пример #1
0
        public void LooseObjectsFailGitProcessIds()
        {
            this.TestSetup(DateTime.UtcNow.AddDays(-7));

            Mock <GitProcessChecker> mockChecker = new Mock <GitProcessChecker>();

            mockChecker.Setup(checker => checker.GetRunningGitProcessIds())
            .Returns(new int[] { 1 });

            LooseObjectsStep step = new LooseObjectsStep(
                this.context,
                requireCacheLock: false,
                forceRun: false,
                gitProcessChecker: mockChecker.Object);

            step.Execute();

            mockChecker.Verify(checker => checker.GetRunningGitProcessIds(), Times.Once());

            this.tracer.StartActivityTracer.RelatedErrorEvents.Count.ShouldEqual(0);
            this.tracer.StartActivityTracer.RelatedWarningEvents.Count.ShouldEqual(1);
            List <string> commands = this.gitProcess.CommandsRun;

            commands.Count.ShouldEqual(0);
        }
Пример #2
0
        public void LooseObjectsFailTimeRestriction()
        {
            this.TestSetup(DateTime.UtcNow);

            LooseObjectsStep step = new LooseObjectsStep(this.context, requireCacheLock: false, forceRun: false);

            step.Execute();

            this.tracer.StartActivityTracer.RelatedErrorEvents.Count.ShouldEqual(0);
            this.tracer.StartActivityTracer.RelatedWarningEvents.Count.ShouldEqual(1);
            List <string> commands = this.gitProcess.CommandsRun;

            commands.Count.ShouldEqual(0);
        }
Пример #3
0
        public void LooseObjectsPassTimeRestriction()
        {
            this.TestSetup(DateTime.UtcNow.AddDays(-7));

            LooseObjectsStep step = new LooseObjectsStep(this.context, requireCacheLock: false, forceRun: false);

            step.Execute();

            this.tracer.StartActivityTracer.RelatedErrorEvents.Count.ShouldEqual(0);
            this.tracer.StartActivityTracer.RelatedWarningEvents.Count.ShouldEqual(0);
            List <string> commands = this.gitProcess.CommandsRun;

            commands.Count.ShouldEqual(2);
            commands[0].ShouldEqual(PrunePackedCommand);
            commands[1].ShouldEqual(this.packCommand);
        }