public void VerifyNullGuard()
        {
            var dummy = DateTimeOffset.UtcNow.AddSeconds(1.0);
            var sut = new MinDateVersionFilter(dummy);

            string reason;
            Should.Throw<ArgumentNullException>(() => sut.Exclude(null, out reason));
        }
        public void ExcludeShouldAcceptVersionWithNullCommit()
        {
            var version = new BaseVersion("dummy", false, new SemanticVersion(1), null, string.Empty);
            var futureDate = DateTimeOffset.UtcNow.AddYears(1);
            var sut = new MinDateVersionFilter(futureDate);

            string reason;
            sut.Exclude(version, out reason).ShouldBeFalse();
            reason.ShouldBeNull();
        }
        public void WhenShaMismatchShouldNotExclude()
        {
            var commit = new MockCommit(); //when = UtcNow
            var version = new BaseVersion("dummy", false, new SemanticVersion(1), commit, string.Empty);
            var pastDate = DateTimeOffset.UtcNow.AddYears(-1);
            var sut = new MinDateVersionFilter(pastDate);

            string reason;
            sut.Exclude(version, out reason).ShouldBeFalse();
            reason.ShouldBeNull();
        }
        public void WhenCommitShouldExcludeWithReason()
        {
            var commit = new MockCommit(); //when = UtcNow
            var version = new BaseVersion("dummy", false, new SemanticVersion(1), commit, string.Empty);
            var futureDate = DateTimeOffset.UtcNow.AddYears(1);
            var sut = new MinDateVersionFilter(futureDate);

            string reason;
            sut.Exclude(version, out reason).ShouldBeTrue();
            reason.ShouldNotBeNullOrWhiteSpace();
        }