Sha256: b2c65f219278e45c01593432e2145b1b9ad7ff52a40480d2d393a6a795c063c3

Contents?: true

Size: 1.2 KB

Versions: 7

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

require 'helper'

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

  assert_methods_are_deterministic(
    FFaker::AddressDA,
    :city, :full_address, :kommune, :post_nr, :region, :state, :street_address,
    :street_name, :zip_code
  )

  def test_zip_code
    assert_match(/\A\d{4}\z/, FFaker::AddressDA.zip_code)
  end

  def test_post_nr
    assert_match(/\A\d{4}\z/, FFaker::AddressDA.post_nr)
  end

  def test_state
    assert_match(/\A[-ÆØÅæøåa-z-]+\z/i, FFaker::AddressDA.state)
  end

  def test_kommune
    assert_match(/\A[-ÆØÅæøåa-z-]+\z/i, FFaker::AddressDA.kommune)
  end

  def test_region
    assert_match(/\A[ÆØÅæøåa-z-]+\z/i, FFaker::AddressDA.region)
  end

  def test_city
    assert_match(/\A[- ÆØÅæøåla-z-]+\z/i, FFaker::AddressDA.city)
  end

  def test_street_name
    assert_match(/\A[. éÆØÅæøåla-z0-9-]+\z/i, FFaker::AddressDA.street_name)
  end

  def test_street_address
    assert_match(/\A[. éÆØÅæøåla-z0-9-]+\z/i, FFaker::AddressDA.street_address)
  end

  def test_full_address
    assert_match(/\A[. éÆØÅæøåla-z0-9-]+ DANMARK\z/i,
                 FFaker::AddressDA.full_address)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ffaker-2.18.0 test/test_address_da.rb
ffaker-2.17.0 test/test_address_da.rb
ffaker-2.16.0 test/test_address_da.rb
ffaker-2.15.0 test/test_address_da.rb
ffaker-2.14.0 test/test_address_da.rb
ffaker-2.13.0 test/test_address_da.rb
ffaker-2.12.0 test/test_address_da.rb