Sha256: 56d1cd77eb4abc370c46f3a50be53b609e7bc652b8a6f8c20d7ad40f2db565eb

Contents?: true

Size: 1022 Bytes

Versions: 25

Compression:

Stored size: 1022 Bytes

Contents

require 'test_helper'
class FacetTest < Test::Unit::TestCase
  def test_new
    facet = Exlibris::Primo::Facet.new(:raw_xml => "<FACET NAME=\"creator\" COUNT=\"3\">"+
      "<FACET_VALUES KEY=\"Author1, FirstName\" VALUE=\"3\"/>"+
      "<FACET_VALUES KEY=\"Author2, FirstName\" VALUE=\"1\"/>"+
      "</FACET>")
    assert_equal "creator", facet.name
    assert_equal "creator", facet.display_name
    assert_equal 3, facet.size
    assert_equal 2, facet.facet_values.size
  end

  def test_facet_label
    Exlibris::Primo.configure do |config|
      config.facet_labels = {"lcc" => "LC Subject Headings"}
    end
    facet = Exlibris::Primo::Facet.new(:raw_xml => "<FACET NAME=\"lcc\" COUNT=\"3\">"+
      "<FACET_VALUES KEY=\"A. Some Value\" VALUE=\"3\"/>"+
      "<FACET_VALUES KEY=\"B. Some Other Value\" VALUE=\"1\"/>"+
      "</FACET>")
    assert_equal "lcc", facet.name
    assert_equal "LC Subject Headings", facet.display_name
    assert_equal 3, facet.size
    assert_equal 2, facet.facet_values.size
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
exlibris-primo-2.1.1 test/facet_test.rb
exlibris-primo-2.1.0 test/facet_test.rb
exlibris-primo-2.0.0 test/facet_test.rb
exlibris-primo-1.1.9 test/facet_test.rb
exlibris-primo-1.1.8 test/facet_test.rb
exlibris-primo-1.1.7 test/facet_test.rb
exlibris-primo-1.1.6 test/facet_test.rb
exlibris-primo-1.1.5 test/facet_test.rb
exlibris-primo-1.1.4 test/facet_test.rb
exlibris-primo-1.1.3 test/facet_test.rb
exlibris-primo-1.1.2 test/facet_test.rb
exlibris-primo-1.1.1 test/facet_test.rb
exlibris-primo-1.1.0 test/facet_test.rb
exlibris-primo-1.0.11 test/facet_test.rb
exlibris-primo-1.0.10 test/facet_test.rb
exlibris-primo-1.0.9 test/facet_test.rb
exlibris-primo-1.0.8 test/facet_test.rb
exlibris-primo-1.0.7 test/facet_test.rb
exlibris-primo-1.0.6 test/facet_test.rb
exlibris-primo-1.0.5 test/facet_test.rb