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.98 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.97 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.96 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.95 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.94 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.93 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.92 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.91 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.90 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.89 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.88 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.87 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.86 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.85 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.84 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.83 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.82 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.81 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.80 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.79 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb