Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
Blocks.Tests BlocksContentTests
Namespace: Blocks.Tests
Assembly: Blocks.Tests (in Blocks.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The BlocksContentTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
BlocksContentTests | Initializes a new instance of the BlocksContentTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
AreFiveBrickBlocksAllowed | ||
ContentWithPrefixSet | ||
DoBlocksStartInARandomColumn | ||
DoBricksSplitInHalfOnExit | ||
GetFilenameWithoutPrefix | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
LoadContentWithNoPrefixSet | ||
LoadContentWithPrefixSet | ||
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, CloseAfterFirstFrame] public void DoBricksSplitInHalfOnExit() { var content = new JewelBlocksContent(); Assert.IsFalse(content.DoBricksSplitInHalfWhenRowFull); content.DoBricksSplitInHalfWhenRowFull = true; Assert.IsTrue(content.DoBricksSplitInHalfWhenRowFull); }
[Test, CloseAfterFirstFrame] public void AreFiveBrickBlocksAllowed() { var content = new JewelBlocksContent(); Assert.IsTrue(content.AreFiveBrickBlocksAllowed); content.AreFiveBrickBlocksAllowed = false; Assert.IsFalse(content.AreFiveBrickBlocksAllowed); }
[Test, CloseAfterFirstFrame] public void DoBlocksStartInARandomColumn() { var content = new JewelBlocksContent(); Assert.IsFalse(content.DoBlocksStartInARandomColumn); content.DoBlocksStartInARandomColumn = true; Assert.IsTrue(content.DoBlocksStartInARandomColumn); }
[Test, CloseAfterFirstFrame] public void GetFilenameWithoutPrefix() { var content = new JewelBlocksContent { Prefix = "ABC" }; Assert.AreEqual("DEF", content.GetFilenameWithoutPrefix("ABCDEF")); Assert.Throws<BlocksContent.FilenameWrongPrefixException>( () => content.GetFilenameWithoutPrefix("ADEF")); Assert.Throws<BlocksContent.FilenameWrongPrefixException>( () => content.GetFilenameWithoutPrefix("AAADEF")); }
[Test, CloseAfterFirstFrame] public void LoadContentWithNoPrefixSet() { var material = new Material(ShaderFlags.Position2DColoredTextured, "FruitBlocks_Block1"); Assert.IsNotNull(material.DiffuseMap); }
[Test, CloseAfterFirstFrame] public void LoadContentWithPrefixSet() { var content = new JewelBlocksContent { Prefix = "Mod1_" }; var material = new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogo"); new Sprite(material, new Rectangle(0.3f, 0.45f, 0.1f, 0.1f)); content.Prefix = "Mod2_"; material = new Material(ShaderFlags.Position2DColoredTextured, "DeltaEngineLogo"); new Sprite(material, new Rectangle(0.6f, 0.45f, 0.1f, 0.1f)); }
[Test, CloseAfterFirstFrame] public void ContentWithPrefixSet() { var content = new JewelBlocksContent { Prefix = "FruitBlocks_" }; var image = content.Load<Image>("Block1"); Assert.IsTrue(image.PixelSize == new Size(4) || image.PixelSize == new Size(64) || image.PixelSize == new Size(128)); content.Prefix = "JewelBlocks_"; image = content.Load<Image>("Block1"); Assert.IsTrue(image.PixelSize == new Size(4) || image.PixelSize == new Size(64) || image.PixelSize == new Size(128)); }
See Also