Exemplo n.º 1
0
        public void VerifyNullGuard2()
        {
            var commit = new MockCommit();
            var sut = new ShaVersionFilter(new[] { commit.Sha });

            string reason;
            Should.Throw<ArgumentNullException>(() => sut.Exclude(null, out reason));
        }
Exemplo n.º 2
0
        public void ExcludeShouldAcceptVersionWithNullCommit()
        {
            var version = new BaseVersion("dummy", false, new SemanticVersion(1), null, string.Empty);
            var sut = new ShaVersionFilter(new[] { "mismatched" });

            string reason;
            sut.Exclude(version, out reason).ShouldBeFalse();
            reason.ShouldBeNull();
        }
Exemplo n.º 3
0
        public void WhenShaMismatchShouldNotExclude()
        {
            var commit = new MockCommit();
            var version = new BaseVersion("dummy", false, new SemanticVersion(1), commit, string.Empty);
            var sut = new ShaVersionFilter(new[] { "mismatched" });

            string reason;
            sut.Exclude(version, out reason).ShouldBeFalse();
            reason.ShouldBeNull();
        }
Exemplo n.º 4
0
        public void WhenShaMatchShouldExcludeWithReason()
        {
            var commit = new MockCommit();
            var version = new BaseVersion("dummy", false, new SemanticVersion(1), commit, string.Empty);
            var sut = new ShaVersionFilter(new[] { commit.Sha });

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