Files
libremetaverse/libsecondlife-cs/libsecondlife.Tests/PrimObjectTests.cs
John Hurliman 96842bb5d6 * Added libsecondlife.Utilities, for all your awesome code that doesn't directly have to do with moving data between the client and the network
* Renamed the tests folder to libsecondlife.Tests
* More NetworkManager hardening code, should throw less warnings now
* Fixed the solution file (again) to be VS C# Express compatible, and removed a missing project reference

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@737 52acb1d6-8a22-11de-b505-999d5b087335
2006-12-18 01:20:10 +00:00

144 lines
4.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Net;
using libsecondlife;
using libsecondlife.Packets;
using NUnit.Framework;
namespace libsecondlife.Tests
{
[TestFixture]
public class PrimObjectTests : Assert
{
[Test]
public void PathBegin()
{
for (byte i = 0; i < byte.MaxValue; i++)
{
float floatValue = PrimObject.PathBeginFloat(i);
byte result = PrimObject.PathBeginByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
[Test]
public void PathEnd()
{
for (byte i = 0; i < byte.MaxValue; i++)
{
float floatValue = PrimObject.PathEndFloat(i);
byte result = PrimObject.PathEndByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
[Test]
public void PathRadiusOffset()
{
for (sbyte i = sbyte.MinValue; i < sbyte.MaxValue; i++)
{
float floatValue = PrimObject.PathRadiusOffsetFloat(i);
sbyte result = PrimObject.PathRadiusOffsetByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
[Test]
public void PathRevolutions()
{
for (byte i = 0; i < byte.MaxValue; i++)
{
float floatValue = PrimObject.PathRevolutionsFloat(i);
byte result = PrimObject.PathRevolutionsByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
[Test]
public void PathScale()
{
for (byte i = 0; i < byte.MaxValue; i++)
{
float floatValue = PrimObject.PathScaleFloat(i);
byte result = PrimObject.PathScaleByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
[Test]
public void PathShear()
{
for (byte i = 0; i < byte.MaxValue; i++)
{
float floatValue = PrimObject.PathShearFloat(i);
byte result = PrimObject.PathShearByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
[Test]
public void PathSkew()
{
for (sbyte i = sbyte.MinValue; i < sbyte.MaxValue; i++)
{
float floatValue = PrimObject.PathSkewFloat(i);
sbyte result = PrimObject.PathSkewByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
[Test]
public void PathTaper()
{
for (sbyte i = sbyte.MinValue; i < sbyte.MaxValue; i++)
{
float floatValue = PrimObject.PathTaperFloat(i);
sbyte result = PrimObject.PathTaperByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
[Test]
public void ProfileBegin()
{
for (byte i = 0; i < byte.MaxValue; i++)
{
float floatValue = PrimObject.ProfileBeginFloat(i);
byte result = PrimObject.ProfileBeginByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
[Test]
public void ProfileEnd()
{
for (byte i = 0; i < byte.MaxValue; i++)
{
float floatValue = PrimObject.ProfileEndFloat(i);
byte result = PrimObject.ProfileEndByte(floatValue);
Assert.IsTrue(result == i, "Started with " + i + ", float value was " + floatValue +
", and ended up with " + result);
}
}
}
}