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); }
public void VigenereCipherHandlerIsNotNull() { // Arrange VigenereCipherHandler vigenereCipherHandler = new VigenereCipherHandler("", ""); // Act string result = vigenereCipherHandler.DecodeText(); // Assert Assert.NotNull(result); }
public void VigenereCipherHandlerEncode() { // Arrange VigenereCipherHandler vigenereCipherHandler = new VigenereCipherHandler("привет", "пока"); // Act string result = vigenereCipherHandler.EncodeText(); // Assert Assert.Equal("яяувфб", result); }
public void VigenereCipherHandlerDecode() { // Arrange VigenereCipherHandler vigenereCipherHandler = new VigenereCipherHandler("бщцфаирщри, бл ячъбиуъ щбюэсяёш гфуаа!!!", "скорпион"); // Act string result = vigenereCipherHandler.DecodeText(); // Assert Assert.Equal("поздравляю, ты получил исходный текст!!!", result); }