Sha256: 2835f43187f1eee7109cbcd169d5be71e75826bd147bd6f29e3e044320694831

Contents?: true

Size: 925 Bytes

Versions: 10

Compression:

Stored size: 925 Bytes

Contents

puts "Yahoo"

require 'test/unit'
require File.dirname(__FILE__) + '/../../src/sobject_attributes'

class SobjectAttributesTest < Test::Unit::TestCase

  def setup 
    @attributes = Salesforce::SObjectAttributes.new 
  end
  
  def test_add_values() 
    assert((not @attributes.changed?))
    
    @attributes['name'] = 'value'    
    assert(@attributes.changed?)
    
    assert_equal('value', @attributes['name'])
    
    assert_equal(Set.new('name'), @attributes.changed_fields)

    @attributes.clear_changed!    
    assert((not @attributes.changed?))
    
    assert_equal('value', @attributes['name'])
  end
  
  def test_enumeration
    10.times { |n| @attributes["name_#{n}"] = "value_#{n}" }
    
    assert_equal(10, @attributes.length)
    
    5.times { |n| @attributes["name_#{n + 10}"] = "value_#{n + 10}" }
    
    @attributes.each { |name, value| assert_equal(name[/_\d/],  value[/_\d/]) }
  end
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
activesalesforce-0.0.2 test/unit/sobject_attributes_test.rb
activesalesforce-0.0.4 test/unit/sobject_attributes_test.rb
activesalesforce-0.0.8 test/unit/sobject_attributes_test.rb
activesalesforce-0.1.0 test/unit/sobject_attributes_test.rb
activesalesforce-0.0.3 test/unit/sobject_attributes_test.rb
activesalesforce-0.0.5 test/unit/sobject_attributes_test.rb
activesalesforce-0.0.6 test/unit/sobject_attributes_test.rb
activesalesforce-0.0.7 test/unit/sobject_attributes_test.rb
activesalesforce-0.0.9 test/unit/sobject_attributes_test.rb
activesalesforce-0.1.1 test/unit/sobject_attributes_test.rb