using System;
using System.Collections.Generic;
using NUnit.Framework;
using ShareeBike.Model.Bikes.BikeInfoNS;
using ShareeBike.Model.Bikes.BikeInfoNS.BC;
using ShareeBike.Model.Bikes.BikeInfoNS.BikeNS;
using ShareeBike.Model.Bikes.BikeInfoNS.DriveNS;
using ShareeBike.Model.State;
namespace SharedBusinessLogic.Tests.Fixtures.ObjectTests.Bike.BC
{
[TestFixture]
public class TestBikeInfo
{
///
/// Dummy subclass to provide assess to protected member for testing.
///
private class TestBikeInfoSubClass : BikeInfo
{
public TestBikeInfoSubClass(
IStateInfo stateInfo,
ShareeBike.Model.Bikes.BikeInfoNS.BikeNS.Bike bike,
DriveMutable drive,
bool? isDemo = DEFAULTVALUEISDEMO,
IEnumerable group = null,
string stationId = null,
Uri operatorUri = null,
RentalDescription tariffDescription = null) : base(
stateInfo,
bike,
drive,
DataSource.Copri,
isDemo,
group,
stationId,
operatorUri,
tariffDescription)
{
}
}
[Test]
public void TestCtorBikeNull()
{
Assert.That(
() => new TestBikeInfoSubClass(new StateInfo(), null, new DriveMutable()),
Throws.ArgumentNullException);
}
[Test]
public void TestCtorDriveNull()
{
Assert.That(
() => new TestBikeInfoSubClass(new StateInfo(), new ShareeBike.Model.Bikes.BikeInfoNS.BikeNS.Bike(string.Empty, LockModel.ILockIt), null),
Throws.ArgumentNullException);
}
}
}