Example #1
0
        public void SolveChallenge_ShouldSolveChallengeInput()
        {
            string input    = Properties.Resources.challenge6.Replace("\n", string.Empty);
            string expected = Properties.Resources.challenge6expected.Replace("\r\n", "");

            string actual = new Challenge6(input, new VigenereCrack()).SolveChallenge().Replace(" \n", "").Replace("\n", ""); //change to regex when not lazy

            Assert.Equal(expected, actual);
        }
 public void HammingDistance_NullValueB_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => Challenge6.HammingDistance(new byte[0], null));
 }
 public void HammingDistance_MismatchByteArraySizes_Throws()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => Challenge6.HammingDistance(new byte[0], new byte[1]));
 }
        public void HammingDistance_ValidData_CorrectDistance()
        {
            var actualDistance = Challenge6.HammingDistance("this is a test", "wokka wokka!!!");

            Assert.Equal(37, actualDistance);
        }