|
| 1 | +/* |
| 2 | +This file is part of the iText (R) project. |
| 3 | +Copyright (c) 1998-2020 iText Group NV |
| 4 | +Authors: iText Software. |
| 5 | +
|
| 6 | +This program is offered under a commercial and under the AGPL license. |
| 7 | +For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. |
| 8 | +
|
| 9 | +AGPL licensing: |
| 10 | +This program is free software: you can redistribute it and/or modify |
| 11 | +it under the terms of the GNU Affero General Public License as published by |
| 12 | +the Free Software Foundation, either version 3 of the License, or |
| 13 | +(at your option) any later version. |
| 14 | +
|
| 15 | +This program is distributed in the hope that it will be useful, |
| 16 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | +GNU Affero General Public License for more details. |
| 19 | +
|
| 20 | +You should have received a copy of the GNU Affero General Public License |
| 21 | +along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 22 | +*/ |
| 23 | +using iText.Html2pdf.Html; |
| 24 | +using iText.Test; |
| 25 | + |
| 26 | +namespace iText.Html2pdf.Attach.Impl.Tags { |
| 27 | + public class InputTagWorkerTest : ExtendedITextTest { |
| 28 | + [NUnit.Framework.Test] |
| 29 | + public virtual void TestNumberInputPreprocessing() { |
| 30 | + NUnit.Framework.Assert.AreEqual("", InputTagWorker.PreprocessInputValue("bear", AttributeConstants.NUMBER) |
| 31 | + ); |
| 32 | + NUnit.Framework.Assert.AreEqual("4", InputTagWorker.PreprocessInputValue("4", AttributeConstants.NUMBER)); |
| 33 | + NUnit.Framework.Assert.AreEqual("04", InputTagWorker.PreprocessInputValue("04", AttributeConstants.NUMBER) |
| 34 | + ); |
| 35 | + NUnit.Framework.Assert.AreEqual("", InputTagWorker.PreprocessInputValue("4.", AttributeConstants.NUMBER)); |
| 36 | + NUnit.Framework.Assert.AreEqual("", InputTagWorker.PreprocessInputValue(".", AttributeConstants.NUMBER)); |
| 37 | + NUnit.Framework.Assert.AreEqual(".9", InputTagWorker.PreprocessInputValue(".9", AttributeConstants.NUMBER) |
| 38 | + ); |
| 39 | + NUnit.Framework.Assert.AreEqual("4.4", InputTagWorker.PreprocessInputValue("4.4", AttributeConstants.NUMBER |
| 40 | + )); |
| 41 | + NUnit.Framework.Assert.AreEqual("-4", InputTagWorker.PreprocessInputValue("-4", AttributeConstants.NUMBER) |
| 42 | + ); |
| 43 | + NUnit.Framework.Assert.AreEqual("", InputTagWorker.PreprocessInputValue("", AttributeConstants.NUMBER)); |
| 44 | + NUnit.Framework.Assert.AreEqual("", InputTagWorker.PreprocessInputValue("-", AttributeConstants.NUMBER)); |
| 45 | + NUnit.Framework.Assert.AreEqual("-.9", InputTagWorker.PreprocessInputValue("-.9", AttributeConstants.NUMBER |
| 46 | + )); |
| 47 | + NUnit.Framework.Assert.AreEqual("", InputTagWorker.PreprocessInputValue("0-.9", AttributeConstants.NUMBER) |
| 48 | + ); |
| 49 | + } |
| 50 | + } |
| 51 | +} |
0 commit comments