mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-07-12 13:56:27 +02:00
Legacy testing lib added..
This commit is contained in:
parent
0167fc321f
commit
47ed05837e
118 changed files with 17505 additions and 0 deletions
|
@ -0,0 +1,52 @@
|
|||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using System;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
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")),
|
||||
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")),
|
||||
MockRepository.GenerateStub<IUser>(), // user
|
||||
MockRepository.GenerateStub<IInUseStateInfoProvider>(),
|
||||
MockRepository.GenerateStub<IBikesViewModel>()).GetType()); // stateInfoProvider
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue