Esempio n. 1
0
        public XElement InsertSignature(XElement file)
        {
            var data = ExtractDataElement(file);

            var signature = encryption.CalculateSignature(data + settings.Password);

            file.Descendants("signature").Single().Value = signature;

            return(file);
        }
Esempio n. 2
0
        public void InsertSignature_Always_InsertsSignatureIntoCorrespondingElement()
        {
            var builder = Create();

            encryption.CalculateSignature(Arg.Any <string>()).Returns("MD5HASH");

            var file   = XElement.Parse(Request);
            var actual = builder.InsertSignature(file);

            var signature = actual.Descendants("signature").Single().Value;

            Assert.That(signature, Is.EqualTo("MD5HASH"));
        }