Ejemplo n.º 1
0
        public void OnPostGetEncryptedText(string text, string key)
        {
            var folder = Path.Combine(webHostEnvironment.WebRootPath, "files");
            VigenereCipherHandler encoder = new VigenereCipherHandler(text, key);

            FormattedTextEn = encoder.EncodeText();
            FilePath        = Path.Combine(folder, GetIpValue() + "_" + "formattedText.txt");
            System.IO.File.WriteAllText(FilePath, FormattedTextEn);
        }
Ejemplo n.º 2
0
        public void VigenereCipherHandlerEncode()
        {
            // Arrange
            VigenereCipherHandler vigenereCipherHandler = new VigenereCipherHandler("привет", "пока");
            // Act
            string result = vigenereCipherHandler.EncodeText();

            // Assert
            Assert.Equal("яяувфб", result);
        }