コード例 #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."));
        }
コード例 #2
0
ファイル: MockBuildTasks.cs プロジェクト: urbas/Bud.Builder
        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);
        }