private void buttonEncode_Click(object sender, EventArgs e) { var selectedAlg = comboBoxAlgorithmus.SelectedIndex; ICrypto base64 = new Base64(); ICrypto encrypter = new Rijndael(); ICrypto rot13 = new Rot13(); if (entered == 1) { if (selectedAlg == 0) { string encodedText = rot13.Encode(DecodedTextBox.Text); CodedTextBox.Clear(); CodedTextBox.Text = encodedText; } if (selectedAlg == 1) { string encodedText = base64.Encode(DecodedTextBox.Text); CodedTextBox.Clear(); CodedTextBox.Text = encodedText; } if (selectedAlg == 2) { string encodedText = encrypter.Encode(DecodedTextBox.Text); CodedTextBox.Clear(); CodedTextBox.Text = encodedText; } } else { MessageBox.Show("Es ist kein Algorithmus ausgewählt", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void EncodeBasicTest() { TestObj.Encode("test").ShouldBe("grfg"); TestObj.Encode("Test").ShouldBe("Grfg"); }
public void test10plus2_is_twelve() { Rot13 encoder = new Rot13(); Assert.AreEqual("10+2 is twelve.", encoder.Encode("10+2 vf gjryir.")); }
public void TEST_To_GRFG() { Rot13 encoder = new Rot13(); Assert.AreEqual("GRFG", encoder.Encode("TEST")); }
public void Test_To_Grfg() { Rot13 encoder = new Rot13(); Assert.AreEqual("Grfg", encoder.Encode("Test")); }
public void test_To_grfg() { Rot13 encoder = new Rot13(); Assert.AreEqual("grfg", encoder.Encode("test")); }
public void DoubleRot13GivesInputText() { Assert.AreEqual("aBcDeFg", _kata.Encode(_kata.Encode("aBcDeFg"))); }