public void Should_Keep_Numbers_Out_When_Crypt()
        {
            var cypher = new CesarCypher();

            // Assert.Equal("d1e2f3g4h5i6j7k8l9m0", cypher.Crypt("a1b2c3d4e5f6g7h8i9j0"));
            Assert.Equal("wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj", cypher.Crypt("the quick brown fox jumps over the lazy dog"));
        }
Esempio n. 2
0
        public void CryptArgumentoNull()
        {
            string textoEntrada = null;
            var    cesarCypher  = new CesarCypher();

            Assert.Throws <ArgumentNullException>(
                () => cesarCypher.Crypt(textoEntrada)
                );
        }
Esempio n. 3
0
        public void CryptTextoComAcento()
        {
            string textoEntrada = "Chão";
            var    cesarCypher  = new CesarCypher();

            Assert.Throws <ArgumentOutOfRangeException>(
                () => cesarCypher.Crypt(textoEntrada)
                );
        }
Esempio n. 4
0
        public void CryptTextoVazio()
        {
            string textoEntrada  = "";
            string textoEsperado = "";
            var    cesarCypher   = new CesarCypher();
            string textoCifrado  = cesarCypher.Crypt(textoEntrada);

            Assert.Equal(textoCifrado, textoEsperado);
        }
Esempio n. 5
0
        public void CryptTextoComNumerosEspacos()
        {
            string textoEntrada  = "The1 Quick2 Brow3 Fox4 Jumps5 Over6 The7 Lazy8 Dog9 0";
            string textoEsperado = "wkh1 txlfn2 eurz3 ira4 mxpsv5 ryhu6 wkh7 odcb8 grj9 0";

            var    cesarCypher  = new CesarCypher();
            string textoCifrado = cesarCypher.Crypt(textoEntrada);

            Assert.Equal(textoCifrado, textoEsperado);
        }
Esempio n. 6
0
        public void Ignore_UpperCase_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("def", cypher.Crypt("ABC"));
        }
        public void Should_Ensure_Letter_Or_Number_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Throws <ArgumentOutOfRangeException>(() => cypher.Crypt("|abc@"));
        }
        public void Should_Keep_Numbers_Out_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("d1e2f3g4h5i6j7k8l9m0", cypher.Crypt("a1b2c3d4e5f6g7h8i9j0"));
        }
        public void Should_Be_Lower_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("d1e2f3g4h5i6j7k8l9m0", cypher.Crypt("a1b2c3d4e5f6g7h8i9j0".ToUpper()));
        }
Esempio n. 10
0
        public void Should_Crypt_Message()
        {
            var cypher = new CesarCypher();

            Assert.Equal("wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj", cypher.Crypt("the quick brown fox jumps over the lazy dog"));
        }
Esempio n. 11
0
        public void Should_Return_Only_Blank_Spaces_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("     ", cypher.Crypt("     "));
        }
Esempio n. 12
0
        public void Overflow_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("zabc", cypher.Crypt("wxyz"));
        }
Esempio n. 13
0
        public void Should_Retun_Numbers_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("def", cypher.Crypt("ABC"));
        }
Esempio n. 14
0
        public void Should_Return_Empty_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Empty(cypher.Crypt(string.Empty));
        }
Esempio n. 15
0
        public void Ignore_Spaces_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("d e f", cypher.Crypt("a b c"));
        }
Esempio n. 16
0
        public void Empty_Message_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal(string.Empty, cypher.Crypt(string.Empty));
        }
Esempio n. 17
0
        public void Should_Keep_White_Space_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("d 1e2f3g4h5i6j7k8l9m0abc", cypher.Crypt("a 1b2c3d4e5f6g7h8i9j0xyz"));
        }
Esempio n. 18
0
        public void Should_Not_Accept_Argument_Out_Of_Range_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Throws <ArgumentOutOfRangeException>(() => cypher.Crypt("é palhaçada"));
        }
Esempio n. 19
0
 public void Should_Not_Accept_Null_When_Crypt()
 {
     Assert.Throws <ArgumentNullException>(() => cypher.Crypt(null));
 }
Esempio n. 20
0
        public void Should_Not_Accept_Accentuation_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Throws <ArgumentOutOfRangeException>(() => cypher.Crypt("âãàáêẽèéîĩìíôõòóûũùú"));
        }
Esempio n. 21
0
        public void Teste_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("whvwh 123 frp hvsdfr abc", cypher.Crypt("teste 123 com espaco xyz"));
        }
        public void Should_Not_Accept_Special_Char_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Throws <ArgumentOutOfRangeException>(() => cypher.Crypt("a0ç"));
        }
Esempio n. 23
0
        public void Teste_Crypt_Maiuscula()
        {
            var cypher = new CesarCypher();

            Assert.Equal("whvwh frp hvsdfr abc", cypher.Crypt("Teste COM espaco XYZ"));
        }
        public void Should_Keep_Numbers_Out_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Equal("d", cypher.Crypt("a"));
        }
Esempio n. 25
0
        public void Teste_Crypt_Branco()
        {
            var cypher = new CesarCypher();

            Assert.Equal(" ", cypher.Crypt(" "));
        }
        public void Should_Not_Accept_Null_When_Crypt()
        {
            var cypher = new CesarCypher();

            Assert.Throws <ArgumentNullException>(() => cypher.Crypt(null));
        }
Esempio n. 27
0
        public void Teste_Crypt_Erro_Caracter_Invalido()
        {
            var cypher = new CesarCypher();

            Assert.Throws <ArgumentOutOfRangeException>(() => cypher.Crypt("Teste COM ç"));
        }