Sha256: c20e00b4fdb984575eb84584fbd27926f1c875b3fd0d290ea72234917b7cd3ba

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require_relative 'helper'

class TestNameVN < Test::Unit::TestCase
  include DeterministicHelper

  assert_methods_are_deterministic(
    FFaker::NameVN,
    :last_name, :first_name, :middle_name, :name, :last_first
  )

  def setup
    @tester = FFaker::NameVN
  end

  def test_last_name
    assert_include @tester::LAST_NAMES, @tester.last_name
  end

  def test_first_name
    assert_include @tester::FIRST_NAMES, @tester.first_name
  end

  def test_middle_name
    assert_include @tester::MIDDLE_NAMES, @tester.middle_name
  end

  def test_name
    (middle_name, first_name, last_name) = @tester.name.split(' ')
    assert_include @tester::FIRST_NAMES, first_name
    assert_include @tester::MIDDLE_NAMES, middle_name
    assert_include @tester::LAST_NAMES, last_name
  end

  def test_last_first
    (last_name, middle_name, first_name) = @tester.last_first.split(' ')
    assert_include @tester::FIRST_NAMES, first_name
    assert_include @tester::MIDDLE_NAMES, middle_name
    assert_include @tester::LAST_NAMES, last_name
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ffaker-2.23.0 test/test_name_vn.rb
ffaker-2.22.0 test/test_name_vn.rb
ffaker-2.21.0 test/test_name_vn.rb
ffaker-2.20.0 test/test_name_vn.rb
ffaker-2.19.0 test/test_name_vn.rb