File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import unittest
2+
3+ from pyvalueobjects .strings .nullable_string import NullableString
4+
5+
6+ class TestNullableStringValueObject (unittest .TestCase ):
7+ def test_value_return_input_value (self ):
8+ vo = NullableString ('' )
9+ self .assertEqual ('' , vo .value ())
10+
11+ def test_from_string_method_returns_string (self ):
12+ vo = NullableString .from_int (39 )
13+ self .assertEqual ('39' , vo .value ())
14+
15+ def test_from_float_method_returns_int_format_string (self ):
16+ vo = NullableString .from_float (39.0 )
17+ self .assertEqual ('39.0' , vo .value ())
18+
19+ def test_zero_value_return_input_value (self ):
20+ vo = NullableString .from_int (0 )
21+ self .assertEqual ('0' , vo .value ())
22+
23+ def test_basic_string (self ):
24+ vo = NullableString ('patata' )
25+ self .assertEqual ('patata' , vo .value ())
26+
27+ def test_none_return_none (self ):
28+ vo = NullableString (None )
29+ self .assertEqual (None , vo .value ())
You can’t perform that action at this time.
0 commit comments