FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/embed_tests/pyiter.cs at v2.2.0-dev1 · attackgithub/pythonnet · GitHub
attackgithub
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
embed_tests
/
pyiter.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (39 loc) · 1.07 KB
Breadcrumbs
pythonnet
/
src
/
embed_tests
/
pyiter.cs
Copy path
File metadata and controls
43 lines (39 loc) · 1.07 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
using
System
;
using
System
.
Collections
.
Generic
;
using
NUnit
.
Framework
;
using
Python
.
Runtime
;
namespace
Python
.
EmbeddingTest
{
[
TestFixture
]
public
class
PyIterTest
{
private
IntPtr
gs
;
[
SetUp
]
public
void
SetUp
(
)
{
PythonEngine
.
Initialize
(
)
;
gs
=
PythonEngine
.
AcquireLock
(
)
;
}
[
TearDown
]
public
void
TearDown
(
)
{
PythonEngine
.
ReleaseLock
(
gs
)
;
PythonEngine
.
Shutdown
(
)
;
}
[
Test
]
public
void
TestOnPyList
(
)
{
PyList
list
=
new
PyList
(
)
;
list
.
Append
(
new
PyString
(
"foo"
)
)
;
list
.
Append
(
new
PyString
(
"bar"
)
)
;
list
.
Append
(
new
PyString
(
"baz"
)
)
;
List
<
string
>
result
=
new
List
<
string
>
(
)
;
foreach
(
PyObject
item
in
list
)
result
.
Add
(
item
.
ToString
(
)
)
;
Assert
.
AreEqual
(
3
,
result
.
Count
)
;
Assert
.
AreEqual
(
"foo"
,
result
[
0
]
)
;
Assert
.
AreEqual
(
"bar"
,
result
[
1
]
)
;
Assert
.
AreEqual
(
"baz"
,
result
[
2
]
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL