Inheritance Hierarchy
DeltaEngine.Tests.Datatypes EulerAnglesTests
Namespace: DeltaEngine.Tests.Datatypes
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The EulerAnglesTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
EulerAnglesTests | Initializes a new instance of the EulerAnglesTests class |
Methods
Name | Description | |
---|---|---|
Create | ||
Equals | ||
EulerAnglesToString | ||
GetHashCodeViaDictionary |
Examples
[Test] public void Create() { var euler = new EulerAngles(1, 2, 3); Assert.AreEqual(euler.Pitch, 1); Assert.AreEqual(euler.Yaw, 2); Assert.AreEqual(euler.Roll, 3); }
[Test] public void Equals() { var euler1 = new EulerAngles(1, 2, 3); var euler2 = new EulerAngles(3, 4, 5); Assert.AreNotEqual(euler1, euler2); Assert.AreEqual(euler1, new EulerAngles(1, 2, 3)); Assert.IsTrue(euler1 == new EulerAngles(1, 2, 3)); Assert.IsTrue(euler1 != euler2); Assert.IsTrue(euler1.Equals((object)new EulerAngles(1, 2, 3))); }
[Test] public void GetHashCodeViaDictionary() { var first = new EulerAngles(1, 2, 3); var second = new EulerAngles(3, 4, 5); var eulerAngles = new Dictionary<EulerAngles, int> { { first, 1 }, { second, 2 } }; Assert.IsTrue(eulerAngles.ContainsKey(first)); Assert.IsTrue(eulerAngles.ContainsKey(second)); Assert.IsFalse(eulerAngles.ContainsKey(new EulerAngles(5, 6, 7))); }
[Test] public void EulerAnglesToString() { Assert.AreEqual("Pitch: 3 Yaw: 4 Roll: 5", new EulerAngles(3, 4, 5).ToString()); }
See Also