private void EncryptDecryptFile(string fn)
        {
            var text          = _filesystem.LoadText(fn);
            var encryptedText = ROT13.EncryptDecrypt(text);

            _filesystem.ReplaceOriginalWithProcessed(fn, encryptedText);
            this.OnFileProcessed(fn);
        }
Beispiel #2
0
        public void ReplaceEncryptedWithTxt()
        {
            var sourceFilename = "e.txt.encrypted";

            File.WriteAllText(sourceFilename, "encrypted");

            var sut = new FilesystemProvider();

            sut.ReplaceOriginalWithProcessed(sourceFilename, "unencrypted");

            Assert.Equal("unencrypted", File.ReadAllText(Path.GetFileNameWithoutExtension(sourceFilename)));
            Assert.False(File.Exists(sourceFilename));
        }
Beispiel #3
0
        public void ReplaceTxtWithEncrypted()
        {
            var sourceFilename = "u.txt";

            File.WriteAllText(sourceFilename, "unencrypted");

            var sut = new FilesystemProvider();

            sut.ReplaceOriginalWithProcessed(sourceFilename, "encrypted");

            Assert.Equal("encrypted", File.ReadAllText(sourceFilename + ".encrypted"));
            Assert.False(File.Exists(sourceFilename));
        }