Class: Solitaire::TestCipher

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/quiz1/t/solutions/Moses Hohman/test_cipher.rb

Instance Method Summary collapse

Instance Method Details

#test_crypt_idempotentObject



61
62
63
64
65
66
# File 'lib/quiz1/t/solutions/Moses Hohman/test_cipher.rb', line 61

def test_crypt_idempotent
	cipher = Cipher.new("GLNCQ MJAFF FVOMB JIYCB")
	assert_equal("decrypt", cipher.mode)
	assert_equal("CODEI NRUBY LIVEL ONGER", cipher.crypt)
	assert_equal("CODEI NRUBY LIVEL ONGER", cipher.crypt)
end

#test_decryptObject



55
56
57
58
59
# File 'lib/quiz1/t/solutions/Moses Hohman/test_cipher.rb', line 55

def test_decrypt
	cipher = Cipher.new("GLNCQ MJAFF FVOMB JIYCB")
	assert_equal("decrypt", cipher.mode)
	assert_equal("CODEI NRUBY LIVEL ONGER", cipher.crypt)
end

#test_encryptObject



49
50
51
52
53
# File 'lib/quiz1/t/solutions/Moses Hohman/test_cipher.rb', line 49

def test_encrypt
	cipher = Cipher.new("Code in Ruby, live longer!")
	assert_equal("encrypt", cipher.mode)
	assert_equal("GLNCQ MJAFF FVOMB JIYCB", cipher.crypt)
end