mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 18:46:30 +01:00
53 lines
2.5 KiB
C#
53 lines
2.5 KiB
C#
using NUnit.Framework;
|
|
using Rhino.Mocks;
|
|
using System;
|
|
using TestFramework.Model.Services.Geolocation;
|
|
using TestFramework.Services.BluetoothLock;
|
|
using TINK.Model.Device;
|
|
using TINK.Model.User;
|
|
using TINK.ViewModel;
|
|
using TINK.ViewModel.Bikes;
|
|
using TINK.ViewModel.Bikes.Bike;
|
|
|
|
namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|
{
|
|
[TestFixture]
|
|
public class TestBikeViewModelFactory
|
|
{
|
|
[Test]
|
|
public void TestCreate()
|
|
{
|
|
Assert.AreEqual(
|
|
typeof(TINK.ViewModel.Bikes.Bike.BC.BikeViewModel),
|
|
BikeViewModelFactory.Create(
|
|
() => false, // Is connected delegate,
|
|
(isconnected) => null, // connectorFactory
|
|
new GeolocationMock(), // geolocation
|
|
new LocksServiceMock(), // lock service
|
|
(index) => { }, // bikeRemoveDelegate
|
|
null, // viewUpdateManager
|
|
NSubstitute.Substitute.For<ISmartDevice>(),
|
|
null, // viewService
|
|
new TINK.Model.Bike.BC.BikeInfoMutable(new TINK.Model.Bike.BluetoothLock.BikeInfo("42", 5200544, new Guid("00000000-0000-0000-0000-000000000001"), "42"), "My Station Name"),
|
|
MockRepository.GenerateStub<IUser>(), // user
|
|
MockRepository.GenerateStub<IInUseStateInfoProvider>(),
|
|
MockRepository.GenerateStub<IBikesViewModel>()).GetType()); // stateInfoProvider
|
|
|
|
Assert.AreEqual(
|
|
typeof(TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel),
|
|
BikeViewModelFactory.Create(
|
|
() => false, // Is connected delegate,
|
|
(isconnected) => null, // connectorFactory
|
|
new GeolocationMock(), // geolocation
|
|
new LocksServiceMock(), // lock service
|
|
(index) => { }, // bikeRemoveDelegate
|
|
null, // viewUpdateManager
|
|
NSubstitute.Substitute.For<ISmartDevice>(),
|
|
null, // viewService
|
|
new TINK.Model.Bike.BluetoothLock.BikeInfoMutable(new TINK.Model.Bike.BluetoothLock.BikeInfo("42", 5200544, new Guid("00000000-0000-0000-0000-000000000001"), "42"), "My Station Name"),
|
|
MockRepository.GenerateStub<IUser>(), // user
|
|
MockRepository.GenerateStub<IInUseStateInfoProvider>(),
|
|
MockRepository.GenerateStub<IBikesViewModel>()).GetType()); // stateInfoProvider
|
|
}
|
|
}
|
|
}
|