FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
GeoJSON.Net/src/GeoJSON.Net.Tests/TestBase.cs at master · deRightDirection/GeoJSON.Net · GitHub
deRightDirection
/
GeoJSON.Net
Public
forked from
GeoJSON-Net/GeoJSON.Net
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
GeoJSON.Net
/
src
/
GeoJSON.Net.Tests
/
TestBase.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (32 loc) · 1.12 KB
Breadcrumbs
GeoJSON.Net
/
src
/
GeoJSON.Net.Tests
/
TestBase.cs
Copy path
File metadata and controls
37 lines (32 loc) · 1.12 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
using
System
;
using
System
.
IO
;
using
System
.
Reflection
;
using
System
.
Runtime
.
CompilerServices
;
namespace
GeoJSON
.
Net
.
Tests
{
public
abstract
class
TestBase
{
private
static
readonly
string
AssemblyName
=
typeof
(
TestBase
)
.
Assembly
.
GetName
(
)
.
Name
;
public
static
string
AssemblyDirectory
{
get
{
string
codeBase
=
typeof
(
TestBase
)
.
Assembly
.
CodeBase
;
UriBuilder
uri
=
new
UriBuilder
(
codeBase
)
;
string
path
=
Uri
.
UnescapeDataString
(
uri
.
Path
)
;
return
Path
.
GetDirectoryName
(
path
)
;
}
}
protected
string
GetExpectedJson
(
[
CallerMemberName
]
string
name
=
null
)
{
var
type
=
GetType
(
)
.
Name
;
var
projectFolder
=
GetType
(
)
.
Namespace
.
Substring
(
AssemblyName
.
Length
+
1
)
;
var
path
=
Path
.
Combine
(
AssemblyDirectory
,
@".\"
,
projectFolder
,
type
+
"_"
+
name
+
".json"
)
;
if
(
!
File
.
Exists
(
path
)
)
{
throw
new
FileNotFoundException
(
"file not found at "
+
path
)
;
}
return
File
.
ReadAllText
(
path
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL