Sha256: 1bfd67b62782329b15e163f42dae9c10663f72e25b718b05824651f0fac9b4f7

Contents?: true

Size: 1.09 KB

Versions: 188

Compression:

Stored size: 1.09 KB

Contents

require 'minitest/autorun'
require_relative 'hexadecimal'

class HexadecimalTest < Minitest::Test
  def test_hex_1_is_decimal_1
    assert_equal 1, Hexadecimal.new('1').to_decimal
  end

  def test_hex_c_is_decimal_12
    skip
    assert_equal 12, Hexadecimal.new('c').to_decimal
  end

  def test_hex_10_is_decimal_16
    skip
    assert_equal 16, Hexadecimal.new('10').to_decimal
  end

  def test_hex_af_is_decimal_175
    skip
    assert_equal 175, Hexadecimal.new('af').to_decimal
  end

  def test_hex_100_is_decimal_256
    skip
    assert_equal 256, Hexadecimal.new('100').to_decimal
  end

  def test_hex_19ace_is_decimal_105166
    skip
    assert_equal 105_166, Hexadecimal.new('19ace').to_decimal
  end

  def test_invalid_hex_is_decimal_0
    skip
    assert_equal 0, Hexadecimal.new('carrot').to_decimal
  end

  def test_black
    skip
    assert_equal 0, Hexadecimal.new('000000').to_decimal
  end

  def test_white
    skip
    assert_equal 16_777_215, Hexadecimal.new('ffffff').to_decimal
  end

  def test_yellow
    skip
    assert_equal 16_776_960, Hexadecimal.new('ffff00').to_decimal
  end
end

Version data entries

188 entries across 188 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.138 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.137 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.136 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.135 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.134 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.133 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.132 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.131 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.130 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.129 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.128 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.127 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.126 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.125 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.124 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.123 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.122 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.121 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.120 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb