using Microsoft.VisualStudio.TestTools.UnitTesting; using Encrypter; namespace UnitTestProject { [TestClass] public class UnitTest1 { [TestMethod] public void Encrypt1Test() { string str = "Some simple text"; string expected = "84%112%111%104%34%116%106%111%113%109%104%34%118%104%121%118%"; int way = 1; Assert.AreEqual(new MainWindow().Encrypt(str, way), expected); } [TestMethod] public void Decrypt1Test() { string str = "84%112%111%104%34%116%106%111%113%109%104%34%118%104%121%118%"; string expected = "Some simple text"; int way = 1; Assert.AreEqual(new MainWindow().Decrypt(str, way), expected); } [TestMethod] public void Encrypt2Test() { string str = "Some simple text"; string expected = "83%112%111%104%36%120%111%116%120%117%111%43%128%114%134%131%"; int way = 2; Assert.AreEqual(new MainWindow().Encrypt(str, way), expected); } [TestMethod] public void Decrypt2Test() { string str = "83%112%111%104%36%120%111%116%120%117%111%43%128%114%134%131%"; string expected = "Some simple text"; int way = 2; Assert.AreEqual(new MainWindow().Decrypt(str, way), expected); } [TestMethod] public void Encrypt3Test() { string str = "Some simple text"; string expected = "99%16^?127%16^?125%16^?117%16^?48%16^?131%16^?121%16^?125%16^?128%16^?124%16^?117%16^?48%16^?132%16^?117%16^?136%16^?132%16^?"; int way = 3; Assert.AreEqual(new MainWindow().Encrypt(str, way), expected); } [TestMethod] public void Decrypt3Test() { string str = "99%16^?127%16^?125%16^?117%16^?48%16^?131%16^?121%16^?125%16^?128%16^?124%16^?117%16^?48%16^?132%16^?117%16^?136%16^?132%16^?"; string expected = "Some simple text"; int way = 3; Assert.AreEqual(new MainWindow().Decrypt(str, way), expected); } } }