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
34 changed files
with
1,598 additions
and
651 deletions.
There are no files selected for viewing
139 changes: 71 additions & 68 deletions
139
itext.tests/itext.layout.tests/itext/layout/element/GridContainerTest.cs
Large diffs are not rendered by default.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
itext.tests/itext.layout.tests/itext/layout/properties/GridValueTest.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,58 @@ | ||
/* | ||
This file is part of the iText (R) project. | ||
Copyright (c) 1998-2024 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.Test; | ||
|
||
namespace iText.Layout.Properties { | ||
[NUnit.Framework.Category("UnitTest")] | ||
public class GridValueTest : ExtendedITextTest { | ||
[NUnit.Framework.Test] | ||
public virtual void SizingValueTest() { | ||
GridValue value = GridValue.CreateSizeValue(SizingValue.CreateUnitValue(UnitValue.CreatePointValue(1.3f))); | ||
NUnit.Framework.Assert.AreEqual(GridValue.GridValueType.SIZING, value.GetType()); | ||
NUnit.Framework.Assert.AreEqual(1.3f, (float)value.GetAbsoluteValue(), 0.00001); | ||
value = GridValue.CreateSizeValue(SizingValue.CreateUnitValue(UnitValue.CreatePercentValue(30))); | ||
NUnit.Framework.Assert.AreEqual(GridValue.GridValueType.SIZING, value.GetType()); | ||
NUnit.Framework.Assert.IsNull(value.GetAbsoluteValue()); | ||
NUnit.Framework.Assert.AreEqual(30, value.GetSizingValue().GetUnitValue().GetValue(), 0.00001); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void UnitValueTest() { | ||
GridValue value = GridValue.CreateUnitValue(UnitValue.CreatePointValue(1.3f)); | ||
NUnit.Framework.Assert.AreEqual(GridValue.GridValueType.SIZING, value.GetType()); | ||
NUnit.Framework.Assert.AreEqual(1.3f, (float)value.GetAbsoluteValue(), 0.00001); | ||
value = GridValue.CreateUnitValue(UnitValue.CreatePercentValue(30)); | ||
NUnit.Framework.Assert.AreEqual(GridValue.GridValueType.SIZING, value.GetType()); | ||
NUnit.Framework.Assert.IsNull(value.GetAbsoluteValue()); | ||
NUnit.Framework.Assert.AreEqual(30, value.GetSizingValue().GetUnitValue().GetValue(), 0.00001); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void FlexValueTest() { | ||
GridValue value = GridValue.CreateFlexValue(1.5f); | ||
NUnit.Framework.Assert.AreEqual(GridValue.GridValueType.FLEX, value.GetType()); | ||
NUnit.Framework.Assert.IsNull(value.GetAbsoluteValue()); | ||
NUnit.Framework.Assert.AreEqual(1.5f, (float)value.GetFlexValue(), 0.00001); | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
itext.tests/itext.layout.tests/itext/layout/properties/SizingValueTest.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,57 @@ | ||
/* | ||
This file is part of the iText (R) project. | ||
Copyright (c) 1998-2024 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.Test; | ||
|
||
namespace iText.Layout.Properties { | ||
[NUnit.Framework.Category("UnitTest")] | ||
public class SizingValueTest : ExtendedITextTest { | ||
[NUnit.Framework.Test] | ||
public virtual void UnitValueTest() { | ||
SizingValue value = SizingValue.CreateUnitValue(UnitValue.CreatePointValue(3.2f)); | ||
NUnit.Framework.Assert.AreEqual(SizingValue.SizingValueType.UNIT, value.GetType()); | ||
NUnit.Framework.Assert.AreEqual(3.2f, value.GetUnitValue().GetValue(), 0.00001); | ||
NUnit.Framework.Assert.AreEqual(3.2f, (float)value.GetAbsoluteValue(), 0.00001); | ||
value = SizingValue.CreateUnitValue(UnitValue.CreatePercentValue(30)); | ||
NUnit.Framework.Assert.AreEqual(SizingValue.SizingValueType.UNIT, value.GetType()); | ||
NUnit.Framework.Assert.IsNull(value.GetAbsoluteValue()); | ||
NUnit.Framework.Assert.AreEqual(30, value.GetUnitValue().GetValue(), 0.00001); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void MinMaxContentTest() { | ||
SizingValue value = SizingValue.CreateMinContentValue(); | ||
NUnit.Framework.Assert.AreEqual(SizingValue.SizingValueType.MIN_CONTENT, value.GetType()); | ||
NUnit.Framework.Assert.IsNull(value.GetAbsoluteValue()); | ||
value = SizingValue.CreateMaxContentValue(); | ||
NUnit.Framework.Assert.AreEqual(SizingValue.SizingValueType.MAX_CONTENT, value.GetType()); | ||
NUnit.Framework.Assert.IsNull(value.GetAbsoluteValue()); | ||
} | ||
|
||
[NUnit.Framework.Test] | ||
public virtual void AutoTest() { | ||
SizingValue value = SizingValue.CreateAutoValue(); | ||
NUnit.Framework.Assert.AreEqual(SizingValue.SizingValueType.AUTO, value.GetType()); | ||
NUnit.Framework.Assert.IsNull(value.GetAbsoluteValue()); | ||
} | ||
} | ||
} |
Oops, something went wrong.