using System; using NSubstitute; using NUnit.Framework; using TINK.Model.Bikes.BikeInfoNS.BluetoothLock; using TINK.Model.Bikes.BikeInfoNS.DriveNS; using TINK.Model.Connector; using TINK.Services.BluetoothLock; using TINK.Services.Geolocation; using TINK.ViewModel; namespace TestShareeLib.Model.Bike.BluetoothLock { [TestFixture] public class TestBikeInfoMutalbe { [Test] public void TestCtor() { Assert.That( new BikeInfoMutable( Substitute.For(), Substitute.For(), () => false /* not connected */, (_) => Substitute.For(), () => Substitute.For(), new TINK.Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo( new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike( "MyBikeId", TINK.Model.Bikes.BikeInfoNS.BikeNS.LockModel.ILockIt), new DriveMutable(), TINK.Model.Bikes.BikeInfoNS.BC.DataSource.Copri, 42, new Guid(), "17"), "My Station Name").StationName, Is.EqualTo("My Station Name")); } [Test] public void TestToString() { Assert.That( new BikeInfoMutable( Substitute.For(), Substitute.For(), () => false /* not connected */, (_) => Substitute.For(), () => Substitute.For(), new TINK.Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo( new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike( "MyBikeId", TINK.Model.Bikes.BikeInfoNS.BikeNS.LockModel.ILockIt, TINK.Model.Bikes.BikeInfoNS.BikeNS.WheelType.Trike, TINK.Model.Bikes.BikeInfoNS.BikeNS.TypeOfBike.Cargo), new DriveMutable(), TINK.Model.Bikes.BikeInfoNS.BC.DataSource.Copri, 42, new Guid(), "17"), "My Station Name").ToString(), Is.EqualTo("Id=MyBikeId;type=Cargo;state=Disposable;Lock id=42")); } [Test] public void TestCtorBikeNull() { Assert.That( () => new BikeInfoMutable( Substitute.For(), Substitute.For(), () => false /* not connected */, (_) => Substitute.For(), () => Substitute.For(), null, "My Station Name"), Throws.ArgumentNullException); } } }