sharee.bike-App/TestShareeLib/Model/Bike/TestBike.cs

47 lines
1.6 KiB
C#
Raw Normal View History

2021-05-13 20:09:46 +02:00
using NUnit.Framework;
namespace TestTINKLib.Fixtures.ObjectTests.Bike
{
2022-08-30 15:42:25 +02:00
using TINK.Model.Bikes.BikeInfoNS.BikeNS;
2021-05-13 20:09:46 +02:00
[TestFixture]
public class TestBike
{
[Test]
public void TestConstruct()
{
2022-04-25 22:15:15 +02:00
var l_oBike = new Bike("43", LockModel.ILockIt);
2021-06-26 20:57:55 +02:00
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);
2022-04-25 22:15:15 +02:00
l_oBike = new Bike("43", LockModel.ILockIt, 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()
{
2022-04-25 22:15:15 +02:00
var l_oBike1 = new Bike("43", LockModel.ILockIt);
2021-06-26 20:57:55 +02:00
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);
2022-04-25 22:15:15 +02:00
var l_oBike2 = new Bike("42", LockModel.ILockIt, WheelType.Two, TypeOfBike.Allround);
2021-05-13 20:09:46 +02:00
Assert.IsFalse(l_oBike1 == l_oBike2);
2022-04-25 22:15:15 +02:00
l_oBike2 = new Bike("43", LockModel.ILockIt, WheelType.Mono, TypeOfBike.Allround);
2021-05-13 20:09:46 +02:00
Assert.IsFalse(l_oBike1 == l_oBike2);
2022-04-25 22:15:15 +02:00
l_oBike2 = new Bike("43", LockModel.ILockIt, WheelType.Two, TypeOfBike.Cargo);
2021-05-13 20:09:46 +02:00
Assert.IsFalse(l_oBike1 == l_oBike2);
2022-04-25 22:15:15 +02:00
l_oBike2 = new Bike("43", LockModel.ILockIt, null, null);
2021-05-13 20:09:46 +02:00
Assert.IsTrue(l_oBike1 == l_oBike2);
}
}
}