PhysicsTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Physics2D.Farseer.Tests PhysicsTests

Namespace: DeltaEngine.Physics2D.Farseer.Tests
Assembly: DeltaEngine.Physics2D.Farseer.Tests (in DeltaEngine.Physics2D.Farseer.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class PhysicsTests : TestWithMocksOrVisually

The PhysicsTests type exposes the following members.

Constructors

  NameDescription
Public methodPhysicsTests
Initializes a new instance of the PhysicsTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodChangeGravity
Public methodCheckDefaultValues
Public methodCheckWorldIsSimulated
Public methodCreateBody
Public methodCreateEdge
Public methodCreateEdgeMultiPoints
Public methodCreatePolygon
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodSetUp
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void CheckDefaultValues()
{
    Assert.AreEqual(new Vector2D(0.0f, 98.2f), physics.Gravity);
    Assert.AreEqual(0, physics.Bodies.Count());
}
[Test]
public void ChangeGravity()
{
    physics.Gravity = Vector2D.UnitY;
    Assert.AreEqual(Vector2D.UnitY, physics.Gravity);
}
[Test]
public void CreateBody()
{
    VerifyBodyIsCreated(physics.CreateRectangle(Size.One));
}
[Test]
public void CreateEdge()
{
    VerifyBodyIsCreated(physics.CreateEdge(Vector2D.Zero, Vector2D.One));
}
[Test]
public void CreateEdgeMultiPoints()
{
    VerifyBodyIsCreated(physics.CreateEdge(Vector2Ds));
}
[Test]
public void CreatePolygon()
{
    VerifyBodyIsCreated(physics.CreatePolygon(Vector2Ds));
}
[Test]
public void CheckWorldIsSimulated()
{
    var body = physics.CreateRectangle(Size.One);
    AdvanceTimeAndUpdateEntities();
    Assert.AreNotEqual(Vector2D.Zero, body.Position);
}
See Also