00001 using System;
00002 using System.Text;
00003 using System.Collections.Generic;
00004 using System.Linq;
00005 using Microsoft.VisualStudio.TestTools.UnitTesting;
00006 using NewGamePhysics.Physics;
00007
00008 namespace Tests
00009 {
00013 [TestClass]
00014 public class UnitTestFrictionModel
00015 {
00016 public UnitTestFrictionModel()
00017 {
00018
00019
00020
00021 }
00022
00023 private TestContext testContextInstance;
00024
00029 public TestContext TestContext
00030 {
00031 get
00032 {
00033 return testContextInstance;
00034 }
00035 set
00036 {
00037 testContextInstance = value;
00038 }
00039 }
00040
00041 #region Additional test attributes
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #endregion
00062
00063 [TestMethod]
00064 public void TestFrictionTypeStribeck()
00065 {
00066 RotationalFrictionModel model = new RotationalFrictionModel(RotationalFrictionType.Stribeck);
00067 int steps = 100;
00068 double omegaMin = -1.0;
00069 double omegaMax = 1.0;
00070 double omegaStep = (omegaMax - omegaMin) / steps;
00071 for (int i = 0; i <= steps; i++)
00072 {
00073 double omega = omegaMin + omegaStep * i;
00074 double deltaOmega = model.ApplyFriction(omega) - omega;
00075 System.Console.WriteLine("{0} {1}", omega, deltaOmega);
00076 omega += omegaStep;
00077 }
00078 }
00079 }
00080 }