mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-21 20:46:28 +02:00
Version 3.0.368
This commit is contained in:
parent
24cdfbb0ca
commit
1a58bf58d3
78 changed files with 3104 additions and 2823 deletions
|
@ -56,11 +56,11 @@ namespace TestTINKLib
|
|||
new StateRequestedInfo(() => new DateTime(2017, 09, 20), new DateTime(2017, 09, 19), TimeSpan.FromMinutes(15), "a@b", "372").From);
|
||||
|
||||
Assert.IsTrue(
|
||||
new StateRequestedInfo(() => new DateTime(2017, 09, 20, 12, 12, 0), new DateTime(2017, 09, 20, 12, 0, 0), TimeSpan.FromMinutes(15), "a@b", "372").GetIsStillReserved(out TimeSpan? l_oRemainigTime));
|
||||
new StateRequestedInfo(() => new DateTime(2017, 09, 20, 12, 12, 0), new DateTime(2017, 09, 20, 12, 0, 0), TimeSpan.FromMinutes(15), "a@b", "372").GetIsStillReserved(out TimeSpan? remainingTime));
|
||||
|
||||
Assert.AreEqual(
|
||||
3,
|
||||
l_oRemainigTime.Value.Minutes);
|
||||
remainingTime.Value.Minutes);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -246,56 +246,56 @@ namespace TestShareeLib.Repository.Request
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void TestUpateLockingStateGeolocationIsNull()
|
||||
public void TestUpdateLockingStateGeolocationIsNull()
|
||||
{
|
||||
var builder = new RequestBuilderLoggedIn("MyMeranctIt", null /*UI language */, "MySessionCookie");
|
||||
Assert.That(
|
||||
builder.UpateLockingState("12", lock_state.locked, null /* geolocaion */, 15.03, null /* version info */),
|
||||
builder.UpdateLockingState("12", lock_state.locked, null /* geolocaion */, 15.03, null /* version info */),
|
||||
Is.EqualTo("request=booking_update&bike=12&lock_state=locked&voltage=15.03&authcookie=MySessionCookieMyMeranctIt"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestUpateLockingStateGeolocationIsNullBatteryPercentageIsNAN()
|
||||
public void TestUpdateLockingStateGeolocationIsNullBatteryPercentageIsNAN()
|
||||
{
|
||||
var builder = new RequestBuilderLoggedIn("MyMeranctIt", null /*UI language */, "MySessionCookie");
|
||||
Assert.That(
|
||||
builder.UpateLockingState("12", lock_state.locked, null /* geolocaion */, double.NaN, null /* version info */),
|
||||
builder.UpdateLockingState("12", lock_state.locked, null /* geolocaion */, double.NaN, null /* version info */),
|
||||
Is.EqualTo("request=booking_update&bike=12&lock_state=locked&authcookie=MySessionCookieMyMeranctIt"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestUpateLockingStateGeolocation_AccuraycyNull()
|
||||
public void TestUpdateLockingStateGeolocation_AccuraycyNull()
|
||||
{
|
||||
var builder = new RequestBuilderLoggedIn("MyMeranctIt", null /*UI language */, "MySessionCookie");
|
||||
Assert.That(
|
||||
builder.UpateLockingState("12", lock_state.locked, new LocationDto.Builder { Latitude = 21, Longitude = 17, Age = new TimeSpan(0, 0, 0, 0, 70) }.Build(), 12, null /* version info */),
|
||||
builder.UpdateLockingState("12", lock_state.locked, new LocationDto.Builder { Latitude = 21, Longitude = 17, Age = new TimeSpan(0, 0, 0, 0, 70) }.Build(), 12, null /* version info */),
|
||||
Is.EqualTo("request=booking_update&bike=12&gps=21,17&gps_age=0.07&lock_state=locked&voltage=12&authcookie=MySessionCookieMyMeranctIt"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestUpateLockingStateGeolocation_AccuraycyNullBatteryPercentageIsNAN()
|
||||
public void TestUpdateLockingStateGeolocation_AccuraycyNullBatteryPercentageIsNAN()
|
||||
{
|
||||
var builder = new RequestBuilderLoggedIn("MyMeranctIt", null /*UI language */, "MySessionCookie");
|
||||
Assert.That(
|
||||
builder.UpateLockingState("12", lock_state.locked, new LocationDto.Builder { Latitude = 21, Longitude = 17, Age = new TimeSpan(0, 0, 0, 0, 70) }.Build(), double.NaN, null /* version info */),
|
||||
builder.UpdateLockingState("12", lock_state.locked, new LocationDto.Builder { Latitude = 21, Longitude = 17, Age = new TimeSpan(0, 0, 0, 0, 70) }.Build(), double.NaN, null /* version info */),
|
||||
Is.EqualTo("request=booking_update&bike=12&gps=21,17&gps_age=0.07&lock_state=locked&authcookie=MySessionCookieMyMeranctIt"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestUpateLockingStateGeolocation()
|
||||
public void TestUpdateLockingStateGeolocation()
|
||||
{
|
||||
var builder = new RequestBuilderLoggedIn("MyMeranctIt", null /*UI language */, "MySessionCookie");
|
||||
Assert.That(
|
||||
builder.UpateLockingState("12", lock_state.locked, new LocationDto.Builder { Latitude = 21, Longitude = 17, Accuracy = 5.7, Age = new TimeSpan(0, 0, 0, 0, 70) }.Build(), 98, null /* version info */),
|
||||
builder.UpdateLockingState("12", lock_state.locked, new LocationDto.Builder { Latitude = 21, Longitude = 17, Accuracy = 5.7, Age = new TimeSpan(0, 0, 0, 0, 70) }.Build(), 98, null /* version info */),
|
||||
Is.EqualTo("request=booking_update&bike=12&gps=21,17&gps_accuracy=5.7&gps_age=0.07&lock_state=locked&voltage=98&authcookie=MySessionCookieMyMeranctIt"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestUpateLockingStateVersionsInfo()
|
||||
public void TestUpdateLockingStateVersionsInfo()
|
||||
{
|
||||
var builder = new RequestBuilderLoggedIn("MyMeranctIt", null /*UI language */, "MySessionCookie");
|
||||
Assert.That(
|
||||
WebUtility.UrlDecode(builder.UpateLockingState("12", lock_state.locked, null /* geolocaion */, 15.03, new TINK.Model.Bikes.BikeInfoNS.BluetoothLock.VersionInfo.Builder { FirmwareVersion=13, HardwareVersion=12, LockVersion=14}.Build())),
|
||||
WebUtility.UrlDecode(builder.UpdateLockingState("12", lock_state.locked, null /* geolocaion */, 15.03, new TINK.Model.Bikes.BikeInfoNS.BluetoothLock.VersionInfo.Builder { FirmwareVersion=13, HardwareVersion=12, LockVersion=14}.Build())),
|
||||
Is.EqualTo("request=booking_update&bike=12&lock_state=locked&voltage=15.03&firmware=HW 12;FW 13;Lock 14&authcookie=MySessionCookieMyMeranctIt"));
|
||||
}
|
||||
|
||||
|
|
|
@ -27,15 +27,15 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NSubstitute" Version="5.0.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.5" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.7" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -283,8 +283,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
|||
bikesViewModel.ActionText = "Start query location...";
|
||||
geolocation.GetAsync(Arg.Any<CancellationToken?>(), Arg.Any<DateTime?>());
|
||||
viewService.DisplayAlert(
|
||||
"Error at ending rental!",
|
||||
"End rental at an unknown location is not possible.\r\nGetting geolocation failed.",
|
||||
"Location query failed",
|
||||
"End rental at an unknown location is not possible.\r\nMake sure you have granted location sharing permission and your location services are enabled.\r\nTry again!",
|
||||
"OK");
|
||||
bikesViewModel.ActionText = "Updating...";
|
||||
bikesViewModel.ActionText = string.Empty;
|
||||
|
|
|
@ -53,6 +53,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
null, // viewService
|
||||
new TINK.Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfoMutable(new TINK.Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo(new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("42", LockModel.ILockIt), new Drive(), DataSource.Copri, 5200544, new Guid("00000000-0000-0000-0000-000000000001"), "42"), "My Station Name"),
|
||||
NSubstitute.Substitute.For<IUser>(), // user
|
||||
new ViewContext (PageContext.BikesAtStation, "FR1012"), // Context does not matter for this test.
|
||||
NSubstitute.Substitute.For<IInUseStateInfoProvider>(),
|
||||
NSubstitute.Substitute.For<IBikesViewModel>(),
|
||||
url => { }).GetType()); // stateInfoProvider
|
||||
|
@ -74,6 +75,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
null, // viewService
|
||||
new TINK.Model.Bikes.BikeInfoNS.CopriLock.BikeInfoMutable(new TINK.Model.Bikes.BikeInfoNS.CopriLock.BikeInfo(new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("42", LockModel.ILockIt), new Drive(), TINK.Model.Bikes.BikeInfoNS.BC.DataSource.Copri, "17", new TINK.Model.Bikes.BikeInfoNS.CopriLock.LockInfo.Builder { State = TINK.Model.Bikes.BikeInfoNS.CopriLock.LockingState.Closed }.Build()), "My Station Name"),
|
||||
NSubstitute.Substitute.For<IUser>(), // user
|
||||
new ViewContext(PageContext.BikesAtStation, "FR1012"), // Context does not matter for this test.
|
||||
NSubstitute.Substitute.For<IInUseStateInfoProvider>(),
|
||||
NSubstitute.Substitute.For<IBikesViewModel>(),
|
||||
url => { }).GetType()); // stateInfoProvider
|
||||
|
@ -94,6 +96,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
null, // viewService
|
||||
new BikeInfoMutableUnsupported(new TINK.Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo(new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("42", TINK.Model.Bikes.BikeInfoNS.BikeNS.LockModel.ILockIt), new Drive(), DataSource.Copri, 5200544, new Guid("00000000-0000-0000-0000-000000000001"), "42"), "My Station Name"),
|
||||
NSubstitute.Substitute.For<IUser>(), // user
|
||||
new ViewContext(PageContext.BikesAtStation, "FR1012"), // Context does not matter for this test.
|
||||
NSubstitute.Substitute.For<IInUseStateInfoProvider>(),
|
||||
NSubstitute.Substitute.For<IBikesViewModel>(),
|
||||
url => { }),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue