Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
3bc78081
Commit
3bc78081
authored
Nov 23, 2018
by
mrbean-bremen
Committed by
mrbean-bremen
Dec 18, 2018
Browse files
Added existing file path for MultiThreadingTest
- fixed a few other tests by using the Svg DTD Resolver to avoid web requests
parent
0b5f4ccb
Changes
4
Show whitespace changes
Inline
Side-by-side
Tests/Svg.UnitTests/MarkerEndTest.cs
View file @
3bc78081
...
...
@@ -25,10 +25,8 @@ namespace Svg.UnitTests
[
TestMethod
]
[
Ignore
]
public
void
TestOperatingPlanRendering
()
{
// FIXME: loading file times out - probably regression
LoadSvg
(
GetXMLDocFromResource
());
}
...
...
Tests/Svg.UnitTests/SvgTestHelper.cs
View file @
3bc78081
...
...
@@ -124,6 +124,7 @@ namespace Svg.UnitTests
{
Trace
.
WriteLine
(
"Load XmlDocument from resource data."
);
var
xmlDoc
=
new
XmlDocument
();
xmlDoc
.
XmlResolver
=
new
SvgDtdResolver
();
xmlDoc
.
Load
(
s
);
Trace
.
WriteLine
(
"Done XmlDocument loading from resource data."
);
return
xmlDoc
;
...
...
@@ -151,7 +152,7 @@ namespace Svg.UnitTests
protected
virtual
XmlDocument
GetXMLDocFromFile
(
string
file
)
{
if
(!
File
.
Exists
(
file
))
Assert
.
Fail
(
"Test file missing."
+
Directory
.
GetCurrentDirectory
()
+
file
);
Assert
.
Fail
(
"Test file missing."
,
file
);
var
xmlDoc
=
new
XmlDocument
();
xmlDoc
.
LoadXml
(
File
.
ReadAllText
(
file
));
...
...
Tests/Svg.UnitTests/SvgTextElementDeepCopyTest.cs
View file @
3bc78081
...
...
@@ -16,10 +16,8 @@ namespace Svg.UnitTests
private
const
string
PureTextElementSvg
=
"Issue_TextElement.Text.svg"
;
[
TestMethod
]
[
Ignore
]
public
void
TestSvgTextElementDeepCopy
()
{
// FIXME: test currently times out during loading the file stream
var
svgDocument
=
OpenSvg
(
GetResourceXmlDoc
(
GetFullResourceString
(
PureTextElementSvg
)));
CheckDocument
(
svgDocument
);
...
...
@@ -46,10 +44,12 @@ namespace Svg.UnitTests
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
xmlDocument
=
new
XmlDocument
();
xmlDocument
.
XmlResolver
=
new
SvgDtdResolver
();
xmlDocument
.
Load
(
memoryStream
);
Assert
.
AreEqual
(
2
,
xmlDocument
.
ChildNodes
.
Count
);
var
svgNode
=
xmlDocument
.
ChildNodes
[
1
];
// the first node is the added DTD declaration
Assert
.
AreEqual
(
3
,
xmlDocument
.
ChildNodes
.
Count
);
var
svgNode
=
xmlDocument
.
ChildNodes
[
2
];
// Filter all significant whitespaces.
var
svgChildren
=
svgNode
.
ChildNodes
...
...
Tests/Svg.UnitTests/SvgTextTests.cs
View file @
3bc78081
...
...
@@ -13,10 +13,8 @@ namespace Svg.UnitTests
{
[
TestMethod
]
[
Ignore
]
public
void
TextPropertyAffectsSvgOutput
()
{
// FIXME: test currently times out, maybe regression
var
document
=
new
SvgDocument
();
document
.
Children
.
Add
(
new
SvgText
{
Text
=
"test1"
});
using
(
var
stream
=
new
MemoryStream
())
...
...
@@ -25,6 +23,7 @@ namespace Svg.UnitTests
stream
.
Position
=
0
;
var
xmlDoc
=
new
XmlDocument
();
xmlDoc
.
XmlResolver
=
new
SvgDtdResolver
();
xmlDoc
.
Load
(
stream
);
Assert
.
AreEqual
(
"test1"
,
xmlDoc
.
DocumentElement
.
FirstChild
.
InnerText
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment