public void Validate_GetCommitVerificationMessage(string returnString)
        {
            var objectId = ObjectId.Random();
            var revision = new GitRevision(objectId);

            _module().RunGitCmd($"log --pretty=\"format:%GG\" -1 {objectId}").Returns(returnString);

            var actual = _gpgController.GetCommitVerificationMessage(revision);

            Assert.AreEqual(returnString, actual);
        }
        public void Validate_GetCommitVerificationMessage(string returnString)
        {
            var guid = Guid.NewGuid().ToString("N");

            GitRevision revision = new GitRevision(guid);

            _module().RunGitCmd($"log --pretty=\"format:%GG\" -1 {guid}").Returns(returnString);

            var actual = _gpgController.GetCommitVerificationMessage(revision);

            Assert.AreEqual(returnString, actual);
        }
Esempio n. 3
0
        public void Validate_GetCommitVerificationMessage(string returnString)
        {
            var objectId = ObjectId.Random();
            var revision = new GitRevision(objectId);
            var args     = new GitArgumentBuilder("log")
            {
                "--pretty=\"format:%GG\"",
                "-1",
                revision.Guid
            };

            using var _ = _executable.StageOutput(args.ToString(), returnString);

            var actual = _gpgController.GetCommitVerificationMessage(revision);

            Assert.AreEqual(returnString, actual);
        }
        public void Validate_GetCommitVerificationMessage(string returnString)
        {
            var objectId = ObjectId.Random();
            var revision = new GitRevision(objectId);
            var args     = new GitArgumentBuilder("log")
            {
                "--pretty=\"format:%GG\"",
                "-1",
                revision.Guid
            };

            _module().GitExecutable.GetOutput(Arg.Is <ArgumentString>(arg => arg.Arguments.Equals(args.ToString())))
            .Returns(x => returnString);

            var actual = _gpgController.GetCommitVerificationMessage(revision);

            Assert.AreEqual(returnString, actual);
        }