Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
LogoApp.Tests BouncingLogoTests
Namespace: LogoApp.Tests
Assembly: LogoApp.Tests (in LogoApp.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The BouncingLogoTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | BouncingLogoTests | Initializes a new instance of the BouncingLogoTests class |
Methods
Name | Description | |
---|---|---|
![]() | AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) |
![]() | CallBouncedAction | |
![]() | Create | |
![]() | Draw1000LogosToTestPerformance | |
![]() | Drawing100LogosOnlyCauseOneDrawCall | |
![]() | InitializeResolver | (Inherited from TestWithMocksOrVisually.) |
![]() | PressingSpacePausesLogoApp | |
![]() | RegisterMock T | (Inherited from TestWithMocksOrVisually.) |
![]() | Resolve T | (Inherited from TestWithMocksOrVisually.) |
![]() | RunAFewTimesAndCloseGame | |
![]() | RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) |
![]() | RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) |
![]() | ShowManyLogos |
Properties
Name | Description | |
---|---|---|
![]() | IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test] public void Create() { var logo = new BouncingLogo(); Assert.IsTrue(logo.Center.X > 0); Assert.IsTrue(logo.Center.Y > 0); Assert.AreNotEqual(Color.Black, logo.Color); }
[Test] public void ShowManyLogos() { for (int i = 0; i < 100; i++) new BouncingLogo(); }
[Test] public void Drawing100LogosOnlyCauseOneDrawCall() { for (int i = 0; i < 100; i++) new BouncingLogo(); RunAfterFirstFrame(() => { Assert.AreEqual(1, Resolve<Drawing>().NumberOfDynamicDrawCallsThisFrame); Assert.AreEqual(100 * 4, Resolve<Drawing>().NumberOfDynamicVerticesDrawnThisFrame); }); }
[Test] public void PressingSpacePausesLogoApp() { for (int i = 0; i < 10; i++) new BouncingLogo(); new Command(() => Time.IsPaused = !Time.IsPaused).Add(new KeyTrigger(Key.Space)); }
[Test] public void CallBouncedAction() { var bouncingLogo = new ActionTesterBouncingLogo(); Assert.IsFalse(bouncingLogo.BouncedActionCalled); AdvanceTimeAndUpdateEntities(); Assert.IsTrue(bouncingLogo.BouncedActionCalled); }
[Test, Ignore] public void Draw1000LogosToTestPerformance() { for (int i = 0; i < 1000; i++) new BouncingLogo(); }
[Test, Ignore] public void RunAFewTimesAndCloseGame() { new BouncingLogo(); AdvanceTimeAndUpdateEntities(1.0f); }
See Also