Exemple #1
0
        public void Signature_throws_at_the_beginning()
        {
            var exception = Throws <Exception>(() => {
                var _ = new Sha256Signer().Signature;
            });

            That(exception.Message,
                 DoesContain.Substring("The hash has not yet been calculated. Call 'Finish' to calculate the hash."));
        }
Exemple #2
0
        private static string CalculateSignature(ImmutableArray <BuildTaskResult> dependenciesResults,
                                                 params string[] salts)
        {
            var signer = new Sha256Signer();

            signer.Digest("Dependencies:");

            foreach (var dependencyResult in dependenciesResults)
            {
                signer.Digest(dependencyResult.TaskSignature);
            }

            signer.Digest("Salts:");

            foreach (var salt in salts)
            {
                signer.Digest(salt);
            }

            return(signer.Finish().HexSignature);
        }