FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/embed_tests/pyiter.cs at pypy · 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
30 lines (29 loc) · 858 Bytes
Breadcrumbs
pythonnet
/
src
/
embed_tests
/
pyiter.cs
Copy path
File metadata and controls
30 lines (29 loc) · 858 Bytes
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
using
System
.
Collections
.
Generic
;
using
NUnit
.
Framework
;
using
Python
.
Runtime
;
namespace
Python
.
EmbeddingTest
{
public
class
PyIterTest
{
[
Test
]
public
void
TestOnPyList
(
)
{
using
(
Py
.
GIL
(
)
)
{
var
list
=
new
PyList
(
)
;
list
.
Append
(
new
PyString
(
"foo"
)
)
;
list
.
Append
(
new
PyString
(
"bar"
)
)
;
list
.
Append
(
new
PyString
(
"baz"
)
)
;
var
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