Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Content.Xml.Tests InputCommandsTests
Namespace: DeltaEngine.Content.Xml.Tests
Assembly: DeltaEngine.Content.Xml.Tests (in DeltaEngine.Content.Xml.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The InputCommandsTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
InputCommandsTests | Initializes a new instance of the InputCommandsTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CreateDefaultInputCommandsIfContentNotFound | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
LogErrorIfTriggerTypeDoesNotExist | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
TestInputCommands |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test, CloseAfterFirstFrame] public void TestInputCommands() { var inputCommands = ContentLoader.Load<InputCommands>("DefaultCommands"); Assert.AreEqual("DefaultCommands", inputCommands.Name); Assert.IsTrue(inputCommands.InternalAllowCreationIfContentNotFound); }
[Test, CloseAfterFirstFrame] public void LogErrorIfTriggerTypeDoesNotExist() { var logger = new MockLogger(); Assert.Throws<Command.UnableToRegisterCommandWithoutTriggers>( () => ContentLoader.Load<NoDataInputCommands>("NoDataInputCommands").InternalCreateDefault()); Assert.IsTrue(logger.LastMessage.Contains(NonTriggerTypeName), logger.LastMessage); Assert.IsTrue(logger.LastMessage.Contains("MissingMethodException"), logger.LastMessage); logger.Dispose(); }
[Test, CloseAfterFirstFrame, Timeout(5000)] public void CreateDefaultInputCommandsIfContentNotFound() { var inputCommands = ContentLoader.Load<NotExistingInputCommands>("NotExistingInputCommands"); inputCommands.InternalCreateDefault(); foreach (var commandData in inputCommands.Data.Children) { Assert.IsNotEmpty(commandData.Name); Assert.IsNull(commandData.Value); } var exitCommand = new Command(Command.Exit, (Action)null); List<Trigger> triggers = exitCommand.GetTriggers(); Assert.AreEqual(1, triggers.Count); Assert.AreEqual("KeyTrigger", triggers[0].GetShortNameOrFullNameIfNotFound()); }
See Also