diff options
author | Unknown <thomas.dorsch@gmx.org> | 2018-01-06 19:50:03 +0100 |
---|---|---|
committer | Unknown <thomas.dorsch@gmx.org> | 2018-01-06 19:50:03 +0100 |
commit | c5d597c545e31f14322ebdfec4508fec2b8f8795 (patch) | |
tree | d5d639d843fcd1f0508661385731f1668fe3b7f3 | |
parent | a875bfe6b9d97731804a4a0aa1a1a89863618d95 (diff) | |
download | opentk-c5d597c545e31f14322ebdfec4508fec2b8f8795.tar.gz opentk-c5d597c545e31f14322ebdfec4508fec2b8f8795.tar.bz2 opentk-c5d597c545e31f14322ebdfec4508fec2b8f8795.zip |
Fixed params and names
-rw-r--r-- | tests/OpenTK.Tests.Math/DataProviders/QuaternionTestDataGenerator.cs | 14 | ||||
-rw-r--r-- | tests/OpenTK.Tests.Math/QuaternionTests.cs | 36 |
2 files changed, 21 insertions, 29 deletions
diff --git a/tests/OpenTK.Tests.Math/DataProviders/QuaternionTestDataGenerator.cs b/tests/OpenTK.Tests.Math/DataProviders/QuaternionTestDataGenerator.cs index 19dd76ef..c01bb252 100644 --- a/tests/OpenTK.Tests.Math/DataProviders/QuaternionTestDataGenerator.cs +++ b/tests/OpenTK.Tests.Math/DataProviders/QuaternionTestDataGenerator.cs @@ -11,28 +11,26 @@ namespace OpenTK.Tests.Math.DataProviders /// Returns the single axis test cases. /// 1. param: rotation in euler angles /// 2. param: expected result of xyz-component of quaternion - /// 3. param: test name (Don't found a working way how to pass this to xUnit runner). I let it here for test documentation /// </summary> /// <value>The single axis test cases.</value> public static IEnumerable<object> SingleAxisTestCases() { - yield return new object[] { new Vector3(1, 0, 0), Vector3.UnitX, "Rotate around x axis" }; - yield return new object[] { new Vector3(0, 1, 0), Vector3.UnitY, "Rotate around y axis" }; - yield return new object[] { new Vector3(0, 0, 1), Vector3.UnitZ, "Rotate around z axis" }; + yield return new object[] { new Vector3(1, 0, 0), Vector3.UnitX}; //"Rotate around x axis" + yield return new object[] { new Vector3(0, 1, 0), Vector3.UnitY}; //"Rotate around y axis" + yield return new object[] { new Vector3(0, 0, 1), Vector3.UnitZ}; //"Rotate around z axis" } /// <summary> /// Returns the single ToAxisAngle test cases. /// 1. param: Quaternion which a definied value of xyz-component. /// 2. param: expected result of xyz-component of quaternion - /// 3. param: test name (Don't found a working way how to pass this to xUnit runner). I let it here for test documentation /// </summary> /// <value>The single axis test cases.</value> public static IEnumerable<object[]> ToAxisAngleTestCases() { - yield return new object[] { new Quaternion(Vector3.UnitX, 0), Vector3.UnitX, "Rotate around x axis" }; - yield return new object[] { new Quaternion(Vector3.UnitY, 0), Vector3.UnitY, "Rotate around y axis" }; - yield return new object[] { new Quaternion(Vector3.UnitZ, 0), Vector3.UnitZ, "Rotate around z axis" }; + yield return new object[] { new Quaternion(Vector3.UnitX, 0), Vector3.UnitX}; //"Rotate around x axis" + yield return new object[] { new Quaternion(Vector3.UnitY, 0), Vector3.UnitY}; //"Rotate around y axis" + yield return new object[] { new Quaternion(Vector3.UnitZ, 0), Vector3.UnitZ}; //"Rotate around z axis" } } diff --git a/tests/OpenTK.Tests.Math/QuaternionTests.cs b/tests/OpenTK.Tests.Math/QuaternionTests.cs index 1f078d32..b6b8a220 100644 --- a/tests/OpenTK.Tests.Math/QuaternionTests.cs +++ b/tests/OpenTK.Tests.Math/QuaternionTests.cs @@ -4,23 +4,22 @@ using OpenTK.Tests.Math.DataProviders; namespace OpenTK.Tests.Math { - public class Quaternion_Tests + public class QuaternionTests { /// <summary> - /// Contains all tests which cover the ctor of Quaternion. + /// Contains all tests which cover the constructor of Quaternion. /// </summary> - public class Constructor_Tests + public class Constructor { /// <summary> /// Checks if a single given value (either pitch, yaw or roll) get converted into correct x,y,z value of quaternion. /// </summary> /// <param name="eulerValues">euler angle values</param> /// <param name="expectedResult">expected xyz component of quaternion</param> - /// <param name="testName">Taken from nUnit test data. Don't know how to name data driven tests for xUnit which actually works.</param> [Theory] [MemberData(nameof(QuaternionTestDataGenerator.SingleAxisTestCases), MemberType = typeof(QuaternionTestDataGenerator))] - public void SingleAxisAsEulerAnglesInFloatsIsConvertedToCorrectValueInQuaternion - (Vector3 eulerValues, Vector3 expectedResult, string testName) + public void SingleAxisAsEulerAnglesInFloatsIsConvertedToCorrectQuaternionComponents + (Vector3 eulerValues, Vector3 expectedResult) { //Arrange + Act: Create Quaternion with "pitch/yaw/roll" var cut = new Quaternion(eulerValues.X, eulerValues.Y, eulerValues.Z); @@ -36,11 +35,10 @@ namespace OpenTK.Tests.Math /// </summary> /// <param name="eulerValues">euler angle values</param> /// <param name="expectedResult">expected xyz component of quaternion</param> - /// <param name="testName">Taken from nUnit test data. Don't know how to name data driven tests for xUnit which actually works.</param> [Theory] [MemberData(nameof(QuaternionTestDataGenerator.SingleAxisTestCases), MemberType = typeof(QuaternionTestDataGenerator))] - public void SingleAxisAsEulerAnglesInVector3IsConvertedToCorrectValueInQuaternion - (Vector3 eulerValues, Vector3 expectedResult, string testName) + public void SingleAxisAsEulerAnglesInVector3IsConvertedToCorrectQuaternionComponents + (Vector3 eulerValues, Vector3 expectedResult) { //Arrange + Act: Create Quaternion with "pitch/yaw/roll" var cut = new Quaternion(eulerValues); @@ -57,18 +55,17 @@ namespace OpenTK.Tests.Math /// <summary> /// Contains all tests for FromEulerAngles /// </summary> - public class FromEulerAngles_Tests + public class FromEulerAngles { /// <summary> /// Checks if a single given value (either pitch, yaw or roll) get converted into correct x,y,z value of quaternion. /// </summary> /// <param name="eulerValues">euler angle values</param> /// <param name="expectedResult">expected xyz component of quaternion</param> - /// <param name="testName">Taken from nUnit test data. Don't know how to name data driven tests for xUnit which actually works.</param> [Theory] [MemberData(nameof(QuaternionTestDataGenerator.SingleAxisTestCases), MemberType = typeof(QuaternionTestDataGenerator))] - public void SingleAxisAsEulerAnglesInFloatsIsConvertedToCorrectValueInQuaternion - (Vector3 eulerValues, Vector3 expectedResult, string testName) + public void SingleAxisAsEulerAnglesInFloatsIsConvertedToCorrectQuaternionComponents + (Vector3 eulerValues, Vector3 expectedResult) { //Arrange + Act: Create Quaternion with "pitch/yaw/roll" var cut = Quaternion.FromEulerAngles(eulerValues.X, eulerValues.Y, eulerValues.Z); @@ -84,11 +81,10 @@ namespace OpenTK.Tests.Math /// </summary> /// <param name="eulerValues">euler angle values</param> /// <param name="expectedResult">expected xyz component of quaternion</param> - /// <param name="testName">Taken from nUnit test data. Don't know how to name data driven tests for xUnit which actually works.</param> [Theory] [MemberData(nameof(QuaternionTestDataGenerator.SingleAxisTestCases), MemberType = typeof(QuaternionTestDataGenerator))] - public void SingleAxisAsEulerAnglesInVector3IsConvertedToCorrectValueInQuaternion - (Vector3 eulerValues, Vector3 expectedResult, string testName) + public void SingleAxisAsEulerAnglesInVector3IsConvertedToCorrectQuaternionComponents + (Vector3 eulerValues, Vector3 expectedResult) { //Arrange + Act: Create Quaternion with "pitch/yaw/roll" var cut = Quaternion.FromEulerAngles(eulerValues); @@ -104,11 +100,10 @@ namespace OpenTK.Tests.Math /// </summary> /// <param name="eulerValues">euler angle values</param> /// <param name="expectedResult">expected xyz component of quaternion</param> - /// <param name="testName">Taken from nUnit test data. Don't know how to name data driven tests for xUnit which actually works.</param> [Theory] [MemberData(nameof(QuaternionTestDataGenerator.SingleAxisTestCases), MemberType = typeof(QuaternionTestDataGenerator))] - public void SingleAxisAsEulerAnglesInVector3IsConvertedToCorrectValueInQuaternionAsOutParam - (Vector3 eulerValues, Vector3 expectedResult, string testName) + public void SingleAxisAsEulerAnglesInVector3IsConvertedToCorrectQuaternionComponentsAsOutParam + (Vector3 eulerValues, Vector3 expectedResult) { //Arrange + Act: Create Quaternion with "pitch/yaw/roll" var cut = Quaternion.Identity; @@ -134,10 +129,9 @@ namespace OpenTK.Tests.Math /// </summary> /// <param name="cut">Prepared Quaternion</param> /// <param name="expectedResult">Expected result.</param> - /// <param name="testName">Taken from nUnit test data. Don't know how to name data driven tests for xUnit which actually works.</param> [Theory] [MemberData(nameof(QuaternionTestDataGenerator.ToAxisAngleTestCases), MemberType = typeof(QuaternionTestDataGenerator))] - public void PreparedSingleRotationAxisQuaternionConvertsToCorrectAxisAngleRepresentation(Quaternion cut, Vector3 expectedResult, string testName) + public void PreparedSingleRotationAxisQuaternionConvertsToCorrectAxisAngleRepresentation(Quaternion cut, Vector3 expectedResult) { //Arrange + Act: Create Quaternion with rotation about X/Y/Z axis Vector3 resultXYZ; |