JointTests ClassDelta Engine Documentation
Inheritance Hierarchy

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

Namespace: DeltaEngine.Physics2D.Tests
Assembly: DeltaEngine.Physics2D.Tests (in DeltaEngine.Physics2D.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 methodChangeLineJointFrequency
Public methodChangeLineJointMaxMotorTorque
Public methodChangeLineJointMotorEnabled
Public methodChangeLineJointMotorSpeed
Public methodCheckAngleJointBodies
Public methodCheckRevoluteJointBodies
Public methodCreateAngleJoint
Public methodCreateFixedAngleJoint
Public methodCreateFixedAngleJointOnSingleBody
Public methodCreateRevoluteJoint
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 CreateFixedAngleJoint()
{
    var joint = physics.CreateFixedAngleJoint(body, (float)Math.PI / 3);
    Assert.IsNotNull(joint);
}
[Test]
public void CreateFixedAngleJointOnSingleBody()
{
    var joint = physics.CreateFixedAngleJoint(body, (float)Math.PI / 3);
    Assert.AreEqual(joint.BodyA, body);
    Assert.AreEqual(joint.BodyB, body);
}
[Test]
public void CreateAngleJoint()
{
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateAngleJoint(body, bodyB, (float)Math.PI / 2);
    Assert.IsNotNull(joint);
}
[Test]
public void CheckAngleJointBodies()
{
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateAngleJoint(body, bodyB, (float)Math.PI / 2);
    Assert.AreEqual(joint.BodyA, body);
    Assert.AreEqual(joint.BodyB, bodyB);
}
[Test]
public void CreateRevoluteJoint()
{
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateRevoluteJoint(body, bodyB, Vector2D.Zero);
    Assert.IsNotNull(joint);
}
[Test]
public void CheckRevoluteJointBodies()
{
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateRevoluteJoint(body, bodyB, Vector2D.Zero);
    Assert.AreEqual(joint.BodyA, body);
    Assert.AreEqual(joint.BodyB, bodyB);
}
[Test]
public void ChangeLineJointMotorEnabled()
{
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateLineJoint(body, bodyB, Vector2D.Zero);
    Assert.AreEqual(joint.MotorEnabled, false);
    joint.MotorEnabled = true;
    Assert.AreEqual(joint.MotorEnabled, true);
}
[Test]
public void ChangeLineJointMaxMotorTorque()
{
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateLineJoint(body, bodyB, Vector2D.Zero);
    joint.MaxMotorTorque = 1.0f;
    Assert.AreEqual(joint.MaxMotorTorque, 1.0f);
}
[Test]
public void ChangeLineJointMotorSpeed()
{
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateLineJoint(body, bodyB, Vector2D.Zero);
    joint.MotorSpeed = 4.0f;
    Assert.AreEqual(joint.MotorSpeed, 4.0f);
}
[Test]
public void ChangeLineJointFrequency()
{
    var bodyB = physics.CreateCircle(3.0f);
    var joint = physics.CreateLineJoint(body, bodyB, Vector2D.Zero);
    joint.Frequency = 1.0f;
    Assert.AreEqual(joint.Frequency, 1.0f);
}
See Also