Ejemplo n.º 1
0
        public void When_NullStringIsGiven_Should_RaiseArgumentException()
        {
            Sha512HashingAlgorithm algorithm = new Sha512HashingAlgorithm();

            Assert.ThrowsException <ArgumentException>(() =>
            {
                algorithm.Hash(null);
            });
        }
Ejemplo n.º 2
0
        public void When_ValidStringIsGiven_Should_ProduceValidSha512Hash()
        {
            Sha512HashingAlgorithm algorithm = new Sha512HashingAlgorithm();

            string expected = "n32GJ+Avl8xaUtyyupYDj+EvKjSw+sUOBBNZrhPV7eiopQVi2li6eRbaN45zQ++R6F771qCnCrI3raTCJ03xPQ==";
            string actual   = algorithm.Hash("test");

            Assert.AreEqual(expected, actual);
        }