Skip to content

Commit 3efded0

Browse files
Minor improvements to constructors and MathMLLength
1 parent 24999e3 commit 3efded0

27 files changed

+82
-47
lines changed

MathML.Tests/MathMLGlyphTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void EmptyMathMLGlyphTest()
2727
[TestMethod]
2828
public void MathMLGlyphWithAllAttributesTest()
2929
{
30-
Assert.AreEqual("<mglyph src=\"somefile.png\" alt=\"Some Text\" width=\"12pt\" height=\"14mm\" valign=\"16px\"></mglyph>", _serializer.SerializeMathMLNode(new MathMLGlyph() { AlternativeText = "Some Text", Source = "somefile.png", Width = new MathMLLength(12, MathMLLengthUnit.Points), Height = new MathMLLength(14, MathMLLengthUnit.Millimeters), VerticalAlignment = new MathMLLength(16, MathMLLengthUnit.Pixels) }));
30+
Assert.AreEqual("<mglyph src=\"somefile.png\" alt=\"Some Text\" width=\"12pt\" height=\"14mm\" valign=\"16px\"></mglyph>", _serializer.SerializeMathMLNode(new MathMLGlyph() { AlternativeText = "Some Text", Source = "somefile.png", Width = new MathMLMeasuredLength(12, MathMLMeasuredLengthUnit.Points), Height = new MathMLMeasuredLength(14, MathMLMeasuredLengthUnit.Millimeters), VerticalAlignment = new MathMLMeasuredLength(16, MathMLMeasuredLengthUnit.Pixels) }));
3131
}
3232
}
3333
}

MathML.Tests/MathMLMultiscriptsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void EmptyMathMLMultiscriptsTest()
2727
[TestMethod]
2828
public void MathMLMultiscriptsWithAllAttributesTest()
2929
{
30-
Assert.AreEqual("<mmultiscripts subscriptshift=\"4pt\" superscriptshift=\"8mm\"></mmultiscripts>", _serializer.SerializeMathMLNode(new MathMLMultiscripts() { SubscriptShift = new MathMLLength(4, MathMLLengthUnit.Points), SuperscriptShift = new MathMLLength(8, MathMLLengthUnit.Millimeters) }));
30+
Assert.AreEqual("<mmultiscripts subscriptshift=\"4pt\" superscriptshift=\"8mm\"></mmultiscripts>", _serializer.SerializeMathMLNode(new MathMLMultiscripts() { SubscriptShift = new MathMLMeasuredLength(4, MathMLMeasuredLengthUnit.Points), SuperscriptShift = new MathMLMeasuredLength(8, MathMLMeasuredLengthUnit.Millimeters) }));
3131
}
3232
}
3333
}

MathML.Tests/MathMLOperatorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void MathMLOperatorWithContentTest()
3838
[TestMethod]
3939
public void MathMLOperatorWithAllAttributes()
4040
{
41-
Assert.AreEqual("<mo dir=\"rtl\" mathvariant=\"bold\" form=\"postfix\" largeop=\"true\" movablelimits=\"true\" accent=\"true\" fence=\"true\" stretchy=\"true\" symmetric=\"true\" lspace=\"10pt\" rspace=\"5mm\"></mo>", _serializer.SerializeMathMLNode(new MathMLOperator() { Accent = true, Fence = true, Form = MathMLOperatorForm.Postfix, LargeOperator = true, MovableLimits = true, Stretchy = true, Symmetric = true, LeftSpace = new MathMLLength(10, MathMLLengthUnit.Points), RightSpace = new MathMLLength(5, MathMLLengthUnit.Millimeters), TextDirection = MathMLTextDirection.RightToLeft, MathVariant = MathMLMathVariant.Bold }));
41+
Assert.AreEqual("<mo dir=\"rtl\" mathvariant=\"bold\" form=\"postfix\" largeop=\"true\" movablelimits=\"true\" accent=\"true\" fence=\"true\" stretchy=\"true\" symmetric=\"true\" lspace=\"10pt\" rspace=\"5mm\"></mo>", _serializer.SerializeMathMLNode(new MathMLOperator() { Accent = true, Fence = true, Form = MathMLOperatorForm.Postfix, LargeOperator = true, MovableLimits = true, Stretchy = true, Symmetric = true, LeftSpace = new MathMLMeasuredLength(10, MathMLMeasuredLengthUnit.Points), RightSpace = new MathMLMeasuredLength(5, MathMLMeasuredLengthUnit.Millimeters), TextDirection = MathMLTextDirection.RightToLeft, MathVariant = MathMLMathVariant.Bold }));
4242
}
4343
}
4444
}

MathML.Tests/MathMLPaddedTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void EmptyMathMLPaddedTest()
2727
[TestMethod]
2828
public void MathMLPaddedWithAllAttributes()
2929
{
30-
Assert.AreEqual("<mpadded width=\"10pt\" height=\"5mm\" depth=\"20px\" lspace=\"1in\" voffset=\"15em\"></mpadded>", _serializer.SerializeMathMLNode(new MathMLPadded() { Width = new MathMLLength(10, MathMLLengthUnit.Points), Height = new MathMLLength(5, MathMLLengthUnit.Millimeters), Depth = new MathMLLength(20, MathMLLengthUnit.Pixels), LeftSpace = new MathMLLength(1, MathMLLengthUnit.Inches), VerticalOffset = new MathMLLength(15, MathMLLengthUnit.Em) }));
30+
Assert.AreEqual("<mpadded width=\"10pt\" height=\"5mm\" depth=\"20px\" lspace=\"1in\" voffset=\"15em\"></mpadded>", _serializer.SerializeMathMLNode(new MathMLPadded() { Width = new MathMLMeasuredLength(10, MathMLMeasuredLengthUnit.Points), Height = new MathMLMeasuredLength(5, MathMLMeasuredLengthUnit.Millimeters), Depth = new MathMLMeasuredLength(20, MathMLMeasuredLengthUnit.Pixels), LeftSpace = new MathMLMeasuredLength(1, MathMLMeasuredLengthUnit.Inches), VerticalOffset = new MathMLMeasuredLength(15, MathMLMeasuredLengthUnit.Em) }));
3131
}
3232
}
3333
}

MathML.Tests/MathMLSpaceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void EmptyMathMLSpaceTest()
2727
[TestMethod]
2828
public void MathMLSpaceWithAllAttributesTest()
2929
{
30-
Assert.AreEqual("<mspace width=\"10pt\" height=\"5mm\" depth=\"20px\" linebreak=\"newline\"></mspace>", _serializer.SerializeMathMLNode(new MathMLSpace() { Width = new MathMLLength(10, MathMLLengthUnit.Points), Height = new MathMLLength(5, MathMLLengthUnit.Millimeters), Depth = new MathMLLength(20, MathMLLengthUnit.Pixels), LineBreak = MathMLLineBreak.NewLine }));
30+
Assert.AreEqual("<mspace width=\"10pt\" height=\"5mm\" depth=\"20px\" linebreak=\"newline\"></mspace>", _serializer.SerializeMathMLNode(new MathMLSpace() { Width = new MathMLMeasuredLength(10, MathMLMeasuredLengthUnit.Points), Height = new MathMLMeasuredLength(5, MathMLMeasuredLengthUnit.Millimeters), Depth = new MathMLMeasuredLength(20, MathMLMeasuredLengthUnit.Pixels), LineBreak = MathMLLineBreak.NewLine }));
3131
}
3232
}
3333
}

MathML.Tests/MathMLStyleTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void EmptyMathMLStyleTest()
2727
[TestMethod]
2828
public void MathMLStyleWithAllAttributesTest()
2929
{
30-
Assert.AreEqual("<mstyle dir=\"rtl\" displaystyle=\"false\" decimalpoint=\",\" infixlinebreakstyle=\"duplicate\" scriptlevel=\"10\" scriptminsize=\"15mm\" scriptsizemultiplier=\"2.5\"></mstyle>", _serializer.SerializeMathMLNode(new MathMLStyle() { TextDirection = MathMLTextDirection.RightToLeft, DisplayStyle = false, DecimalPoint = ',', InfixLineBreakStyle = MathMLInfixLineBreakStyle.Duplicate, ScriptLevel = 10, ScriptMinimumSize = new MathMLLength(15, MathMLLengthUnit.Millimeters), ScriptSizeMultiplier = 2.5 }));
30+
Assert.AreEqual("<mstyle dir=\"rtl\" displaystyle=\"false\" decimalpoint=\",\" infixlinebreakstyle=\"duplicate\" scriptlevel=\"10\" scriptminsize=\"15mm\" scriptsizemultiplier=\"2.5\"></mstyle>", _serializer.SerializeMathMLNode(new MathMLStyle() { TextDirection = MathMLTextDirection.RightToLeft, DisplayStyle = false, DecimalPoint = ',', InfixLineBreakStyle = MathMLInfixLineBreakStyle.Duplicate, ScriptLevel = 10, ScriptMinimumSize = new MathMLMeasuredLength(15, MathMLMeasuredLengthUnit.Millimeters), ScriptSizeMultiplier = 2.5 }));
3131
}
3232
}
3333
}

MathML.Tests/MathMLSubscriptSuperscriptTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void EmptyMathMLSubscriptSuperscriptTest()
2727
[TestMethod]
2828
public void MathMLSubscriptSuperscriptWithAllAttributesTest()
2929
{
30-
Assert.AreEqual("<msubsup subscriptshift=\"10pt\" superscriptshift=\"15mm\"></msubsup>", _serializer.SerializeMathMLNode(new MathMLSubscriptSuperscript() { SubscriptShift = new MathMLLength(10, MathMLLengthUnit.Points), SuperscriptShift = new MathMLLength(15, MathMLLengthUnit.Millimeters) }));
30+
Assert.AreEqual("<msubsup subscriptshift=\"10pt\" superscriptshift=\"15mm\"></msubsup>", _serializer.SerializeMathMLNode(new MathMLSubscriptSuperscript() { SubscriptShift = new MathMLMeasuredLength(10, MathMLMeasuredLengthUnit.Points), SuperscriptShift = new MathMLMeasuredLength(15, MathMLMeasuredLengthUnit.Millimeters) }));
3131
}
3232
}
3333
}

MathML.Tests/MathMLSubscriptTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void EmptyMathMLSubscriptTest()
2727
[TestMethod]
2828
public void MathMLSubscriptWithAllAttributesTest()
2929
{
30-
Assert.AreEqual("<msub subscriptshift=\"10pt\"></msub>", _serializer.SerializeMathMLNode(new MathMLSubscript() { Shift = new MathMLLength(10, MathMLLengthUnit.Points) }));
30+
Assert.AreEqual("<msub subscriptshift=\"10pt\"></msub>", _serializer.SerializeMathMLNode(new MathMLSubscript() { Shift = new MathMLMeasuredLength(10, MathMLMeasuredLengthUnit.Points) }));
3131
}
3232
}
3333
}

MathML.Tests/MathMLSuperscriptTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void EmptyMathMLSuperscriptTest()
2727
[TestMethod]
2828
public void MathMLSuperscriptWithAllAttributes()
2929
{
30-
Assert.AreEqual("<msup superscriptshift=\"10pt\"></msup>", _serializer.SerializeMathMLNode(new MathMLSuperscript() { Shift = new MathMLLength(10, MathMLLengthUnit.Points) }));
30+
Assert.AreEqual("<msup superscriptshift=\"10pt\"></msup>", _serializer.SerializeMathMLNode(new MathMLSuperscript() { Shift = new MathMLMeasuredLength(10, MathMLMeasuredLengthUnit.Points) }));
3131
}
3232
}
3333
}

MathML/MathML.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
<Compile Include="MathMLInfixLineBreakStyle.cs" />
6060
<Compile Include="MathMLLabeledTableRow.cs" />
6161
<Compile Include="MathMLLabeledTableRowPlacement.cs" />
62-
<Compile Include="MathMLLength.cs" />
63-
<Compile Include="MathMLLengthUnit.cs" />
62+
<Compile Include="MathMLMeasuredLength.cs" />
63+
<Compile Include="MathMLMeasuredLengthUnit.cs" />
6464
<Compile Include="MathMLLineBreak.cs" />
6565
<Compile Include="MathMLLongDivision.cs" />
6666
<Compile Include="MathMLMath.cs" />

0 commit comments

Comments
 (0)