TextParserTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Rendering2D.Fonts.Tests TextParserTests

Namespace: DeltaEngine.Rendering2D.Fonts.Tests
Assembly: DeltaEngine.Rendering2D.Fonts.Tests (in DeltaEngine.Rendering2D.Fonts.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class TextParserTests : TestWithMocksOrVisually

The TextParserTests type exposes the following members.

Constructors

  NameDescription
Public methodTextParserTests
Initializes a new instance of the TextParserTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodConvertTabsIntoTwoSpaces
Public methodGetTextParser
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodParseEmptyText
Public methodParseMultipleTextLines
Public methodParseSingleTextLine
Public methodParseWithUnsupportedCharacters
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void ParseEmptyText()
{
    var lines = parser.GetLines(GetSpaces(0));
    Assert.AreEqual(0, lines.Count);
}
[Test]
public void ParseSingleTextLine()
{
    var lines = parser.GetLines(GetSpaces(3));
    Assert.AreEqual(1, lines.Count);
    Assert.AreEqual(GetSpaces(3), new string(lines[0].ToArray()));
}
[Test]
public void ParseMultipleTextLines()
{
    var lines = parser.GetLines(GetSpaces(1) + Environment.NewLine + GetSpaces(2));
    Assert.AreEqual(2, lines.Count);
    Assert.AreEqual(GetSpaces(1), new string(lines[0].ToArray()));
    Assert.AreEqual(GetSpaces(2), new string(lines[1].ToArray()));
}
[Test]
public void ConvertTabsIntoTwoSpaces()
{
    var lines = parser.GetLines("\t \t");
    Assert.AreEqual(1, lines.Count);
    Assert.AreEqual(GetSpaces(5), new string(lines[0].ToArray()));
}
[Test]
public void ParseWithUnsupportedCharacters()
{
    var lines = parser.GetLines("äöüÄÖÜ");
    Assert.AreEqual(1, lines.Count);
    Assert.AreEqual(GetSpaces(6), new string(lines[0].ToArray()));
}
See Also