Class: ODDB::State::Drugs::TestGalenicForm

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_state/drugs/galenicform.rb

Defined Under Namespace

Classes: StubApp, StubGalenicForm, StubLookandfeel, StubPointer, StubSession

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



61
62
63
64
65
66
# File 'test/test_state/drugs/galenicform.rb', line 61

def setup
  @session = StubSession.new
  @galform = StubGalenicForm.new
  @galform.update_values({'de'=>'Tabletten', 'fr'=>'comprimés'})
  @state = State::Drugs::GalenicForm.new(@session, @galform)
end

- (Object) test_update1



67
68
69
70
71
72
73
74
75
# File 'test/test_state/drugs/galenicform.rb', line 67

def test_update1
  @session.app.galenic_forms = { 
    'Tabletten'  => @galform, 
    'comprimés'  => @galform,
  }
  @session.user_input = { :de => 'Tabletten',  :fr => 'comprimés'}
  @state.update
  assert_equal(false, @state.error?)
end

- (Object) test_update2



76
77
78
79
80
81
82
83
84
# File 'test/test_state/drugs/galenicform.rb', line 76

def test_update2
  @session.app.galenic_forms = { 
    'Tabletten'  => @galform, 
    'comprimés'  => @galform,
  }
  @session.user_input = { :de => 'Filmtabletten', :fr => 'filmcomprimés'}
  @state.update
  assert_equal(false, @state.error?)
end

- (Object) test_update3



85
86
87
88
89
90
91
92
93
94
95
# File 'test/test_state/drugs/galenicform.rb', line 85

def test_update3
  galform = StubGalenicForm.new
  galform.update_values({'de'=>'Tabletten', 'fr'=>'comprimés'})
  @session.app.galenic_forms = { 
    'Tabletten'  => galform, 
    'comprimés'  => galform,
  }
  @session.user_input = { :de => 'Filmtabletten', :fr => 'filmcomprimés'}
  @state.update
  assert_equal(false, @state.error?)
end

- (Object) test_update4



96
97
98
99
100
101
102
103
104
105
106
# File 'test/test_state/drugs/galenicform.rb', line 96

def test_update4
  galform = StubGalenicForm.new
  galform.update_values({'de'=>'Tabletten', 'fr'=>'comprimés'})
  @session.app.galenic_forms = { 
    'Tabletten'  => galform, 
    'comprimés'  => galform,
  }
  @session.user_input = { :de =>'Tabletten', :fr => 'comprimés'}
  @state.update
  assert_equal(true, @state.error?)
end