sharee.bike-App/SharedBusinessLogic.Tests/Model/Bikes/BikeInfoNS/TestBike.cs
2024-04-09 12:53:23 +02:00

46 lines
1.4 KiB
C#

using NUnit.Framework;
namespace SharedBusinessLogic.Tests.Fixtures.ObjectTests.Bike
{
using ShareeBike.Model.Bikes.BikeInfoNS.BikeNS;
[TestFixture]
public class TestBike
{
[Test]
public void TestConstruct()
{
var l_oBike = new Bike("43", LockModel.ILockIt);
Assert.That(l_oBike.Id, Is.EqualTo("43"));
Assert.That(l_oBike.TypeOfBike, Is.EqualTo(null));
Assert.That(l_oBike.WheelType, Is.EqualTo(null));
l_oBike = new Bike("43", LockModel.ILockIt, WheelType.Mono, TypeOfBike.Cargo);
Assert.That(l_oBike.Id, Is.EqualTo("43"));
Assert.That(l_oBike.TypeOfBike, Is.EqualTo(TypeOfBike.Cargo));
Assert.That(l_oBike.WheelType, Is.EqualTo(WheelType.Mono));
}
[Test]
public void TestCompare()
{
var l_oBike1 = new Bike("43", LockModel.ILockIt);
Assert.That(l_oBike1.Id, Is.EqualTo("43"));
Assert.That(l_oBike1.TypeOfBike, Is.EqualTo(null));
Assert.That(l_oBike1.WheelType, Is.EqualTo(null));
var l_oBike2 = new Bike("42", LockModel.ILockIt, WheelType.Two, TypeOfBike.Allround);
Assert.That(l_oBike1 == l_oBike2, Is.False);
l_oBike2 = new Bike("43", LockModel.ILockIt, WheelType.Mono, TypeOfBike.Allround);
Assert.That(l_oBike1 == l_oBike2, Is.False);
l_oBike2 = new Bike("43", LockModel.ILockIt, WheelType.Two, TypeOfBike.Cargo);
Assert.That(l_oBike1 == l_oBike2, Is.False);
l_oBike2 = new Bike("43", LockModel.ILockIt, null, null);
Assert.That(l_oBike1 == l_oBike2, Is.True);
}
}
}