Inheritance Hierarchy
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
The TextParserTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
TextParserTests | Initializes a new instance of the TextParserTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
ConvertTabsIntoTwoSpaces | ||
GetTextParser | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
ParseEmptyText | ||
ParseMultipleTextLines | ||
ParseSingleTextLine | ||
ParseWithUnsupportedCharacters | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
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