JointTests ClassDelta Engine Documentation
Inheritance Hierarchy

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

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 JointTests : TestWithMocksOrVisually

The JointTests type exposes the following members.

Constructors

  NameDescription
Public methodJointTests
Initializes a new instance of the JointTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
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
Public methodTestAngleJoint
Public methodTestAngleJointBodiesEqual
Public methodTestFixedAngleJoint
Public methodTestFixedAngleJointSameBodies
Public methodTestLineJointFrequency
Public methodTestLineJointMaxMotorTorque
Public methodTestLineJointMotorEnabled
Public methodTestLineJointMotorSpeed
Public methodTestRevoluteJoint
Public methodTestRevoluteJointBodiesEqual
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void TestFixedAngleJoint()
{
    var body = physics.CreateCircle(3.0f);
    var joint = physics.CreateFixedAngleJoint(body, (float)Math.PI / 3);
    Assert.IsNotNull(joint);
}
[Test]
public void TestFixedAngleJointSameBodies()
{
    var body = physics.CreateCircle(3.0f);
    var joint = physics.CreateFixedAngleJoint(body, (float)Math.PI / 3);
    Assert.AreEqual(joint.BodyA, body);
    Assert.AreEqual(joint.BodyB, body);
}
[Test]
public void TestAngleJoint()
{
    var bodyA = physics.CreateCircle(3.0f);
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateAngleJoint(bodyA, bodyB, (float)Math.PI / 2);
    Assert.IsNotNull(joint);
}
[Test]
public void TestAngleJointBodiesEqual()
{
    var bodyA = physics.CreateCircle(3.0f);
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateAngleJoint(bodyA, bodyB, (float)Math.PI / 2);
    Assert.AreEqual(joint.BodyA, bodyA);
    Assert.AreEqual(joint.BodyB, bodyB);
}
[Test]
public void TestRevoluteJoint()
{
    var bodyA = physics.CreateCircle(3.0f);
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateRevoluteJoint(bodyA, bodyB, Vector2D.Zero);
    Assert.IsNotNull(joint);
}
[Test]
public void TestRevoluteJointBodiesEqual()
{
    var bodyA = physics.CreateCircle(3.0f);
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateRevoluteJoint(bodyA, bodyB, Vector2D.Zero);
    Assert.AreEqual(joint.BodyA, bodyA);
    Assert.AreEqual(joint.BodyB, bodyB);
}
[Test]
public void TestLineJointMotorEnabled()
{
    var bodyA = physics.CreateCircle(3.0f);
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateLineJoint(bodyA, bodyB, Vector2D.Zero);
    Assert.AreEqual(joint.MotorEnabled, false);
    joint.MotorEnabled = true;
    Assert.AreEqual(joint.MotorEnabled, true);
}
[Test]
public void TestLineJointMaxMotorTorque()
{
    var bodyA = physics.CreateCircle(3.0f);
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateLineJoint(bodyA, bodyB, Vector2D.Zero);
    joint.MaxMotorTorque = 1.0f;
    Assert.AreEqual(joint.MaxMotorTorque, 1.0f);
}
[Test]
public void TestLineJointMotorSpeed()
{
    var bodyA = physics.CreateCircle(3.0f);
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateLineJoint(bodyA, bodyB, Vector2D.Zero);
    joint.MotorSpeed = 4.0f;
    Assert.AreEqual(joint.MotorSpeed, 4.0f);
}
[Test]
public void TestLineJointFrequency()
{
    var bodyA = physics.CreateCircle(3.0f);
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateLineJoint(bodyA, bodyB, Vector2D.Zero);
    joint.Frequency = 1.0f;
    Assert.AreEqual(joint.Frequency, 1.0f);
}
See Also