forked from pipeline-foundation/itext7-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into devsecops
- Loading branch information
Showing
30 changed files
with
596 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
itext.tests/itext.svg.tests/itext/svg/css/SvgStrokeParameterConverterUnitTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
This file is part of the iText (R) project. | ||
Copyright (c) 1998-2023 Apryse Group NV | ||
Authors: Apryse Software. | ||
This program is offered under a commercial and under the AGPL license. | ||
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. | ||
AGPL licensing: | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
using iText.Svg.Logs; | ||
using iText.Test; | ||
using iText.Test.Attributes; | ||
|
||
namespace iText.Svg.Css { | ||
[NUnit.Framework.Category("UnitTest")] | ||
public class SvgStrokeParameterConverterUnitTest : ExtendedITextTest { | ||
[LogMessage(SvgLogMessageConstant.PERCENTAGE_VALUES_IN_STROKE_DASHARRAY_AND_STROKE_DASHOFFSET_ARE_NOT_SUPPORTED | ||
)] | ||
[NUnit.Framework.Test] | ||
public virtual void TestStrokeDashArrayPercentsAreNotSupported() { | ||
NUnit.Framework.Assert.IsNull(SvgStrokeParameterConverter.ConvertStrokeDashParameters("5,3%", null)); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestStrokeDashArrayOddNumberOfValues() { | ||
SvgStrokeParameterConverter.PdfLineDashParameters result = SvgStrokeParameterConverter.ConvertStrokeDashParameters | ||
("5pt", null); | ||
NUnit.Framework.Assert.IsNotNull(result); | ||
NUnit.Framework.Assert.AreEqual(0, result.GetDashPhase(), 0); | ||
iText.Test.TestUtil.AreEqual(new float[] { 5, 5 }, result.GetDashArray(), 1e-5f); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestEmptyStrokeDashArray() { | ||
SvgStrokeParameterConverter.PdfLineDashParameters result = SvgStrokeParameterConverter.ConvertStrokeDashParameters | ||
("", null); | ||
NUnit.Framework.Assert.IsNull(result); | ||
} | ||
|
||
[LogMessage(SvgLogMessageConstant.PERCENTAGE_VALUES_IN_STROKE_DASHARRAY_AND_STROKE_DASHOFFSET_ARE_NOT_SUPPORTED | ||
)] | ||
[NUnit.Framework.Test] | ||
public virtual void TestStrokeDashOffsetPercentsAreNotSupported() { | ||
SvgStrokeParameterConverter.PdfLineDashParameters result = SvgStrokeParameterConverter.ConvertStrokeDashParameters | ||
("5pt,3pt", "10%"); | ||
NUnit.Framework.Assert.AreEqual(new SvgStrokeParameterConverter.PdfLineDashParameters(new float[] { 5, 3 } | ||
, 0), result); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestEmptyStrokeDashOffset() { | ||
SvgStrokeParameterConverter.PdfLineDashParameters result = SvgStrokeParameterConverter.ConvertStrokeDashParameters | ||
("5pt,3pt", ""); | ||
NUnit.Framework.Assert.AreEqual(new SvgStrokeParameterConverter.PdfLineDashParameters(new float[] { 5, 3 } | ||
, 0), result); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void TestStrokeDashOffset() { | ||
SvgStrokeParameterConverter.PdfLineDashParameters result = SvgStrokeParameterConverter.ConvertStrokeDashParameters | ||
("5pt,3pt", "10"); | ||
NUnit.Framework.Assert.AreEqual(new SvgStrokeParameterConverter.PdfLineDashParameters(new float[] { 5, 3 } | ||
, 7.5f), result); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+126 Bytes
(100%)
...text.svg.tests/resources/itext/svg/JFreeSvgTest/cmp_usingJFreeSvgBarChartFromFileTest.pdf
Binary file not shown.
Binary file modified
BIN
+126 Bytes
(100%)
...xt.svg.tests/resources/itext/svg/JFreeSvgTest/cmp_usingJFreeSvgBarChartFromStringTest.pdf
Binary file not shown.
Binary file modified
BIN
+126 Bytes
(100%)
...ext.svg.tests/resources/itext/svg/JFreeSvgTest/cmp_usingJFreeSvgLineChartFromFileTest.pdf
Binary file not shown.
Binary file modified
BIN
+126 Bytes
(100%)
...t.svg.tests/resources/itext/svg/JFreeSvgTest/cmp_usingJFreeSvgLineChartFromStringTest.pdf
Binary file not shown.
Binary file modified
BIN
+225 Bytes
(100%)
...itext.svg.tests/resources/itext/svg/JFreeSvgTest/cmp_usingJFreeSvgXYChartFromFileTest.pdf
Binary file not shown.
Binary file modified
BIN
+225 Bytes
(100%)
...ext.svg.tests/resources/itext/svg/JFreeSvgTest/cmp_usingJFreeSvgXYChartFromStringTest.pdf
Binary file not shown.
Binary file modified
BIN
+229 Bytes
(110%)
...ests/itext.svg.tests/resources/itext/svg/renderers/impl/StrokeTest/cmp_strokeAdvanced.pdf
Binary file not shown.
Binary file added
BIN
+1.97 KB
...ts/itext.svg.tests/resources/itext/svg/renderers/impl/StrokeTest/cmp_strokeWithDashes.pdf
Binary file not shown.
64 changes: 64 additions & 0 deletions
64
...xt.svg.tests/resources/itext/svg/renderers/impl/StrokeTest/strokeWithDashes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.