File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -50,4 +50,36 @@ public SubclassConstructorTest(Exception v)
50
50
this . value = v ;
51
51
}
52
52
}
53
+ public class ToDoubleConstructorTest
54
+ {
55
+ public ToDoubleConstructorTest ( )
56
+ {
57
+ //Just default values
58
+ }
59
+ public ToDoubleConstructorTest ( string a , double b , string c )
60
+ {
61
+ this . a = a ;
62
+ this . b = b ;
63
+ this . c = c ;
64
+ }
65
+ public string a ;
66
+ public double b ;
67
+ public string c ;
68
+ }
69
+ public class ToFloatConstructorTest
70
+ {
71
+ public ToFloatConstructorTest ( )
72
+ {
73
+ // just default values.
74
+ }
75
+ public ToFloatConstructorTest ( string a , float b , string c )
76
+ {
77
+ this . a = a ;
78
+ this . b = b ;
79
+ this . c = c ;
80
+ }
81
+ public string a ;
82
+ public float b ;
83
+ public string c ;
84
+ }
53
85
}
Original file line number Diff line number Diff line change @@ -44,9 +44,18 @@ class sub(System.Exception):
44
44
45
45
instance = sub ()
46
46
ob = SubclassConstructorTest (instance )
47
- print (ob )
48
47
self .assertTrue (isinstance (ob .value , System .Exception ))
49
48
49
+ def testIntToDoubleConstructorArguments (self ):
50
+ from Python .Test import ToDoubleConstructorTest
51
+
52
+ o = ToDoubleConstructorTest ('a' ,2 ,'c' )
53
+ self .assertEqual (o .a ,'a' )
54
+ self .assertAlmostEqual (o .b ,2 )
55
+ self .assertEqual (o .c ,'c' )
56
+
57
+ o = ToDoubleConstructorTest ()
58
+
50
59
51
60
def test_suite ():
52
61
return unittest .makeSuite (ConstructorTests )
You can’t perform that action at this time.
0 commit comments