2021-05-13 20:09:46 +02:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace TestTINKLib.Fixtures.ObjectTests.Bike
|
|
|
|
|
{
|
|
|
|
|
using TINK.Model.Bike;
|
|
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class TestBike
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestConstruct()
|
|
|
|
|
{
|
2021-06-26 20:57:55 +02:00
|
|
|
|
var l_oBike = new Bike("43");
|
|
|
|
|
Assert.AreEqual("43", l_oBike.Id);
|
2021-05-13 20:09:46 +02:00
|
|
|
|
Assert.AreEqual(null, l_oBike.TypeOfBike);
|
|
|
|
|
Assert.AreEqual(null, l_oBike.WheelType);
|
|
|
|
|
|
2021-06-26 20:57:55 +02:00
|
|
|
|
l_oBike = new Bike("43", WheelType.Mono, TypeOfBike.Cargo);
|
2021-05-13 20:09:46 +02:00
|
|
|
|
|
2021-06-26 20:57:55 +02:00
|
|
|
|
Assert.AreEqual("43", l_oBike.Id);
|
2021-05-13 20:09:46 +02:00
|
|
|
|
Assert.AreEqual(TypeOfBike.Cargo, l_oBike.TypeOfBike);
|
|
|
|
|
Assert.AreEqual(WheelType.Mono, l_oBike.WheelType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestCompare()
|
|
|
|
|
{
|
2021-06-26 20:57:55 +02:00
|
|
|
|
var l_oBike1 = new Bike("43");
|
|
|
|
|
Assert.AreEqual("43", l_oBike1.Id);
|
2021-05-13 20:09:46 +02:00
|
|
|
|
Assert.AreEqual(null, l_oBike1.TypeOfBike);
|
|
|
|
|
Assert.AreEqual(null, l_oBike1.WheelType);
|
|
|
|
|
|
2021-06-26 20:57:55 +02:00
|
|
|
|
var l_oBike2 = new Bike("42", WheelType.Two, TypeOfBike.Allround);
|
2021-05-13 20:09:46 +02:00
|
|
|
|
Assert.IsFalse(l_oBike1 == l_oBike2);
|
|
|
|
|
|
2021-06-26 20:57:55 +02:00
|
|
|
|
l_oBike2 = new Bike("43", WheelType.Mono, TypeOfBike.Allround);
|
2021-05-13 20:09:46 +02:00
|
|
|
|
Assert.IsFalse(l_oBike1 == l_oBike2);
|
|
|
|
|
|
2021-06-26 20:57:55 +02:00
|
|
|
|
l_oBike2 = new Bike("43", WheelType.Two, TypeOfBike.Cargo);
|
2021-05-13 20:09:46 +02:00
|
|
|
|
Assert.IsFalse(l_oBike1 == l_oBike2);
|
|
|
|
|
|
2021-06-26 20:57:55 +02:00
|
|
|
|
l_oBike2 = new Bike("43", null, null);
|
2021-05-13 20:09:46 +02:00
|
|
|
|
Assert.IsTrue(l_oBike1 == l_oBike2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|