public static void SolveChallenge_ShouldSolveChallenge()
        {
            string input    = "Burning 'em, if you ain't quick and nimble\nI go crazy when I hear a cymbal";
            string expected = "0b3637272a2b2e63622c2e69692a23693a2a3c6324202d623d63343c2a26226324272765272a282b2f20430a652e2c652a3124333a653e2b2027630c692b20283165286326302e27282f";

            string actual = new Challenge5(input, "ICE", new VigenerCipher()).SolveChallenge();

            Assert.Equal(expected, actual);
        }
예제 #2
0
 public void Setup()
 {
     sut = new Challenge5();
 }
 public void RepeatingKeyXor_NullByteKey_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => Challenge5.RepeatingKeyXor(null, new byte[0]));
 }
 public void RepeatingKeyXor_NullKey_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => Challenge5.RepeatingKeyXor(null, "source"));
 }
 public void RepeatingKeyXor_NullSource_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => Challenge5.RepeatingKeyXor("key", null));
 }
        public void RepeatingKeyXor_ValidData_ValidResult()
        {
            var result = Challenge5.RepeatingKeyXor(Challenge5Data.Key, Challenge5Data.DecryptedValue);

            Assert.Equal(Challenge5Data.EncryptedHexValue, result);
        }