FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/testing/exceptiontest.cs at master · ashsvis/pythonnet · GitHub
ashsvis
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
testing
/
exceptiontest.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
110 lines (92 loc) · 2.51 KB
Breadcrumbs
pythonnet
/
src
/
testing
/
exceptiontest.cs
Copy path
File metadata and controls
110 lines (92 loc) · 2.51 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
using
System
;
using
System
.
Collections
;
using
System
.
Collections
.
Generic
;
namespace
Python
.
Test
{
/// <summary>
/// Supports CLR Exception unit tests.
/// </summary>
public
class
ExceptionTest
{
public
int
ThrowProperty
{
get
{
throw
new
OverflowException
(
"error"
)
;
}
set
{
throw
new
OverflowException
(
"error"
)
;
}
}
public
static
Exception
GetBaseException
(
)
{
return
new
Exception
(
"error"
)
;
}
public
static
OverflowException
GetExplicitException
(
)
{
return
new
OverflowException
(
"error"
)
;
}
public
static
Exception
GetWidenedException
(
)
{
return
new
OverflowException
(
"error"
)
;
}
public
static
ExtendedException
GetExtendedException
(
)
{
return
new
ExtendedException
(
"error"
)
;
}
public
static
bool
SetBaseException
(
Exception
e
)
{
return
typeof
(
Exception
)
.
IsInstanceOfType
(
e
)
;
}
public
static
bool
SetExplicitException
(
OverflowException
e
)
{
return
typeof
(
OverflowException
)
.
IsInstanceOfType
(
e
)
;
}
public
static
bool
SetWidenedException
(
Exception
e
)
{
return
typeof
(
Exception
)
.
IsInstanceOfType
(
e
)
;
}
public
static
bool
ThrowException
(
)
{
throw
new
OverflowException
(
"error"
)
;
}
public
static
IEnumerable
<
int
>
ThrowExceptionInIterator
(
Exception
e
)
{
yield
return
1
;
yield
return
2
;
throw
e
;
}
public
static
void
ThrowChainedExceptions
(
)
{
try
{
try
{
throw
new
Exception
(
"Innermost exception"
)
;
}
catch
(
Exception
exc
)
{
throw
new
Exception
(
"Inner exception"
,
exc
)
;
}
}
catch
(
Exception
exc2
)
{
throw
new
Exception
(
"Outer exception"
,
exc2
)
;
}
}
}
public
class
ExtendedException
:
OverflowException
{
public
ExtendedException
(
)
{
}
public
ExtendedException
(
string
m
)
:
base
(
m
)
{
}
public
string
extra
=
"extra"
;
public
string
ExtraProperty
{
get
{
return
extra
;
}
set
{
extra
=
value
;
}
}
public
string
GetExtraInfo
(
)
{
return
extra
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL