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.180 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.179 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.178 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.177 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.176 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.175 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.174 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.173 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.172 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.171 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.170 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.169 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.167 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.166 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.165 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.164 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.163 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.162 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.161 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb
trackler-2.2.1.160 tracks/ruby/exercises/hexadecimal/hexadecimal_test.rb