mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-22 15:06:26 +01:00
Version 3.0.356
This commit is contained in:
parent
d23aff6daf
commit
5980410182
48 changed files with 242 additions and 362 deletions
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.LastenradBayern" android:versionName="3.0.354" android:versionCode="354">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.LastenradBayern" android:versionName="3.0.356" android:versionCode="356">
|
||||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
||||||
<!-- Google Maps related permissions -->
|
<!-- Google Maps related permissions -->
|
||||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<key>UIBackgroundModes</key>
|
<key>UIBackgroundModes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>bluetooth-peripheral</string>
|
<string>bluetooth-peripheral</string>
|
||||||
|
<string>bluetooth-central</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UIUserInterfaceStyle</key>
|
<key>UIUserInterfaceStyle</key>
|
||||||
<string>Light</string>
|
<string>Light</string>
|
||||||
|
@ -55,8 +56,8 @@
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>LastenradBayern</string>
|
<string>LastenradBayern</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>354</string>
|
<string>356</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.0.354</string>
|
<string>3.0.356</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
|
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
|
||||||
|
@ -27,12 +27,6 @@
|
||||||
Text="{x:Static resources:AppResources.MessageAccountPageManageLogout}"
|
Text="{x:Static resources:AppResources.MessageAccountPageManageLogout}"
|
||||||
Command="{Binding OnLogoutRequest}"
|
Command="{Binding OnLogoutRequest}"
|
||||||
IsEnabled="{Binding IsLogoutPossible}"/>
|
IsEnabled="{Binding IsLogoutPossible}"/>
|
||||||
<!--Possible SecondaryButton Style-->
|
|
||||||
<!--<Button
|
|
||||||
Style="{StaticResource SecondaryButton}"
|
|
||||||
Text="{x:Static resources:AppResources.MessageAccountPageManageLogout}"
|
|
||||||
Command="{Binding OnLogoutRequest}"
|
|
||||||
IsEnabled="{Binding IsLogoutPossible}"/>-->
|
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
|
|
@ -51,13 +51,6 @@
|
||||||
IsVisible="{Binding IsLockitButtonVisible}"
|
IsVisible="{Binding IsLockitButtonVisible}"
|
||||||
IsEnabled="{Binding IsIdle}"
|
IsEnabled="{Binding IsIdle}"
|
||||||
Command="{Binding OnLockitButtonClicked}"/>
|
Command="{Binding OnLockitButtonClicked}"/>
|
||||||
<!--Possible SecondaryButton Style-->
|
|
||||||
<!--<Button
|
|
||||||
Style="{StaticResource SecondaryButton}"
|
|
||||||
Text="{Binding LockitButtonText}"
|
|
||||||
IsVisible="{Binding IsLockitButtonVisible}"
|
|
||||||
IsEnabled="{Binding IsIdle}"
|
|
||||||
Command="{Binding OnLockitButtonClicked}"/>-->
|
|
||||||
<!-- Copri Lock Label -->
|
<!-- Copri Lock Label -->
|
||||||
<Label
|
<Label
|
||||||
Text="{x:Static resources:AppResources.StatusTextCopriLock}"
|
Text="{x:Static resources:AppResources.StatusTextCopriLock}"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:conv="clr-namespace:TINK.View"
|
xmlns:conv="clr-namespace:TINK.View"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
@ -61,14 +61,6 @@
|
||||||
Text="{Binding PhoneNumberText}"
|
Text="{Binding PhoneNumberText}"
|
||||||
IsEnabled="{Binding IsDoPhoncallAvailable}"
|
IsEnabled="{Binding IsDoPhoncallAvailable}"
|
||||||
Command="{Binding OnPhoneRequest}"/>
|
Command="{Binding OnPhoneRequest}"/>
|
||||||
<!--Possible SecondaryButton Style-->
|
|
||||||
<!--<Button
|
|
||||||
Style="{StaticResource SecondaryButton}"
|
|
||||||
x:Name="PhoneNumberButton"
|
|
||||||
IsVisible="{Binding PhoneNumberText, Converter={StaticResource StringNotNullOrEmpty_Converter}}"
|
|
||||||
Text="{Binding PhoneNumberText}"
|
|
||||||
IsEnabled="{Binding IsDoPhoncallAvailable}"
|
|
||||||
Command="{Binding OnPhoneRequest}"/>-->
|
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame>
|
<Frame>
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
Text="{x:Static resources:AppResources.MessageAccountPageManagePersonalData}"/>
|
Text="{x:Static resources:AppResources.MessageAccountPageManagePersonalData}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Shell.TitleView>
|
</Shell.TitleView>
|
||||||
<!-- Cross as BackButton -->
|
|
||||||
<!--<Shell.BackButtonBehavior>
|
|
||||||
<BackButtonBehavior IconOverride="{FontImage FontFamily=FA-S, Glyph={StaticResource IconClose}, Color=White, Size=16}" />
|
|
||||||
</Shell.BackButtonBehavior>-->
|
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
Text="{x:Static resources:AppResources.ActionLoginPasswordForgotten}"/>
|
Text="{x:Static resources:AppResources.ActionLoginPasswordForgotten}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Shell.TitleView>
|
</Shell.TitleView>
|
||||||
<!-- Cross as BackButton -->
|
|
||||||
<!--<Shell.BackButtonBehavior>
|
|
||||||
<BackButtonBehavior IconOverride="{FontImage FontFamily=FA-S, Glyph={StaticResource IconClose}, Color=White, Size=16}" />
|
|
||||||
</Shell.BackButtonBehavior>-->
|
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
Text="{x:Static resources:AppResources.ActionLoginRegister}"/>
|
Text="{x:Static resources:AppResources.ActionLoginRegister}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Shell.TitleView>
|
</Shell.TitleView>
|
||||||
<!-- Cross as BackButton -->
|
|
||||||
<!--<Shell.BackButtonBehavior>
|
|
||||||
<BackButtonBehavior IconOverride="{FontImage FontFamily=FA-S, Glyph={StaticResource IconClose}, Color=White, Size=16}" />
|
|
||||||
</Shell.BackButtonBehavior>-->
|
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
|
|
@ -59,102 +59,4 @@
|
||||||
</Frame>
|
</Frame>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
<!-- Possible New Design -->
|
|
||||||
<!--<ScrollView>
|
|
||||||
<Frame>
|
|
||||||
<StackLayout x:Name="LoginPageView">
|
|
||||||
<Frame>
|
|
||||||
<StackLayout>
|
|
||||||
<Label Text="{x:Static resources:AppResources.MarkingLoginEmailAddressLabel}"
|
|
||||||
Margin="0,0,0,-10">
|
|
||||||
<Label.Triggers>
|
|
||||||
<DataTrigger
|
|
||||||
TargetType="Label"
|
|
||||||
Binding="{Binding Source={x:Reference EMailEntry}, Path=Text, TargetNullValue=''}"
|
|
||||||
Value="">
|
|
||||||
<Setter Property="IsVisible" Value="False" />
|
|
||||||
</DataTrigger>
|
|
||||||
</Label.Triggers>
|
|
||||||
</Label>
|
|
||||||
<Entry
|
|
||||||
Placeholder="{x:Static resources:AppResources.MarkingLoginEmailAddressPlaceholder}"
|
|
||||||
Keyboard="Email"
|
|
||||||
AutomationId="mail_address_text"
|
|
||||||
x:Name="EMailEntry"
|
|
||||||
Text="{Binding MailAddress}"
|
|
||||||
IsEnabled="{Binding IsLoggedOut}"/>
|
|
||||||
<Label Text="{x:Static resources:AppResources.MarkingLoginPasswordPlaceholder}"
|
|
||||||
Margin="0,0,0,-10">
|
|
||||||
<Label.Triggers>
|
|
||||||
<DataTrigger
|
|
||||||
TargetType="Label"
|
|
||||||
Binding="{Binding Source={x:Reference PasswordEntry}, Path=Text, TargetNullValue=''}"
|
|
||||||
Value="">
|
|
||||||
<Setter Property="IsVisible" Value="False" />
|
|
||||||
</DataTrigger>
|
|
||||||
</Label.Triggers>
|
|
||||||
</Label>
|
|
||||||
<Entry Placeholder="{x:Static resources:AppResources.MarkingLoginPasswordPlaceholder}"
|
|
||||||
AutomationId="password_text"
|
|
||||||
IsPassword="true"
|
|
||||||
x:Name="PasswordEntry"
|
|
||||||
Text="{Binding Password}"
|
|
||||||
IsEnabled="{Binding IsLoggedOut}"/>
|
|
||||||
<Label Text="{x:Static resources:AppResources.MarkingLoginPasswordLabel}"
|
|
||||||
HorizontalOptions="End"
|
|
||||||
Margin="0,-10,0,5"
|
|
||||||
FontSize="Small">
|
|
||||||
<Label.Triggers>
|
|
||||||
<DataTrigger
|
|
||||||
TargetType="Label"
|
|
||||||
Binding="{Binding Source={x:Reference PasswordEntry}, Path=Text, TargetNullValue=''}"
|
|
||||||
Value="">
|
|
||||||
<Setter Property="IsVisible" Value="False" />
|
|
||||||
</DataTrigger>
|
|
||||||
</Label.Triggers>
|
|
||||||
</Label>
|
|
||||||
<Button
|
|
||||||
Text="{x:Static resources:AppResources.ActionLoginLogin}"
|
|
||||||
AutomationId="login_button"
|
|
||||||
Command="{Binding OnLoginRequest}"
|
|
||||||
IsEnabled="{Binding IsLoginRequestAllowed}">
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
Text="{x:Static resources:AppResources.ActionLoginRegister}"
|
|
||||||
AutomationId="register_button"
|
|
||||||
Command="{Binding OnRegisterRequest}"
|
|
||||||
IsVisible="{Binding IsWebViewElementsVisible}">
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
Style="{StaticResource SecondaryButton}"
|
|
||||||
Text="{x:Static resources:AppResources.ActionLoginRegister}"
|
|
||||||
AutomationId="register_button"
|
|
||||||
Command="{Binding OnRegisterRequest}"
|
|
||||||
IsVisible="{Binding IsWebViewElementsVisible}">
|
|
||||||
</Button>
|
|
||||||
<Label
|
|
||||||
IsVisible="{Binding IsRegisterTargetsInfoVisible}"
|
|
||||||
FormattedText="{Binding RegisterTargetsInfo}">
|
|
||||||
</Label>
|
|
||||||
<Button
|
|
||||||
Text="{x:Static resources:AppResources.ActionLoginPasswordForgotten}"
|
|
||||||
AutomationId="password_forgotten_button"
|
|
||||||
Command="{Binding OnPasswordForgottonRequest}">
|
|
||||||
</Button>
|
|
||||||
<Label
|
|
||||||
Margin="0,10,0,0"
|
|
||||||
TextType="Html"
|
|
||||||
AutomationId="password_forgotten_button"
|
|
||||||
HorizontalOptions="Center"
|
|
||||||
TextColor="{DynamicResource primary-back-title-color}"
|
|
||||||
Text="{x:Static resources:AppResources.ActionLoginPasswordForgotten}">
|
|
||||||
<Label.GestureRecognizers>
|
|
||||||
<TapGestureRecognizer Command="{Binding OnPasswordForgottonRequest}"/>
|
|
||||||
</Label.GestureRecognizers>
|
|
||||||
</Label>
|
|
||||||
</StackLayout>
|
|
||||||
</Frame>
|
|
||||||
</StackLayout>
|
|
||||||
</Frame>
|
|
||||||
</ScrollView>-->
|
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.Meinkonrad" android:versionName="3.0.354" android:versionCode="354">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.Meinkonrad" android:versionName="3.0.356" android:versionCode="356">
|
||||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
||||||
<!-- Google Maps related permissions -->
|
<!-- Google Maps related permissions -->
|
||||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<key>UIBackgroundModes</key>
|
<key>UIBackgroundModes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>bluetooth-peripheral</string>
|
<string>bluetooth-peripheral</string>
|
||||||
|
<string>bluetooth-central</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UIUserInterfaceStyle</key>
|
<key>UIUserInterfaceStyle</key>
|
||||||
<string>Light</string>
|
<string>Light</string>
|
||||||
|
@ -55,8 +56,8 @@
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>Mein konrad</string>
|
<string>Mein konrad</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>354</string>
|
<string>356</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.0.354</string>
|
<string>3.0.356</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.hauffware.sharee" android:versionName="3.0.354" android:versionCode="354">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.hauffware.sharee" android:versionName="3.0.356" android:versionCode="356">
|
||||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" />
|
||||||
<!-- Google Maps related permissions -->
|
<!-- Google Maps related permissions -->
|
||||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<key>UIBackgroundModes</key>
|
<key>UIBackgroundModes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>bluetooth-peripheral</string>
|
<string>bluetooth-peripheral</string>
|
||||||
|
<string>bluetooth-central</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UIUserInterfaceStyle</key>
|
<key>UIUserInterfaceStyle</key>
|
||||||
<string>Light</string>
|
<string>Light</string>
|
||||||
|
@ -55,8 +56,8 @@
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>sharee.bike</string>
|
<string>sharee.bike</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>354</string>
|
<string>356</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.0.354</string>
|
<string>3.0.356</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
@ -127,7 +127,7 @@ namespace TINK.Model.Connector
|
||||||
await Task.CompletedTask;
|
await Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task DoBook(Bikes.BikeInfoNS.BC.IBikeInfoMutable bike)
|
public async Task DoBookAsync(Bikes.BikeInfoNS.BC.IBikeInfoMutable bike, LockingAction? nextAction = null)
|
||||||
{
|
{
|
||||||
Log.ForContext<Command>().Error("Unexpected booking request detected. No user logged in.");
|
Log.ForContext<Command>().Error("Unexpected booking request detected. No user logged in.");
|
||||||
await Task.CompletedTask;
|
await Task.CompletedTask;
|
||||||
|
|
|
@ -238,7 +238,8 @@ namespace TINK.Model.Connector
|
||||||
|
|
||||||
/// <summary> Request to book a bike. </summary>
|
/// <summary> Request to book a bike. </summary>
|
||||||
/// <param name="bike">Bike to book.</param>
|
/// <param name="bike">Bike to book.</param>
|
||||||
public async Task DoBook(Bikes.BikeInfoNS.BC.IBikeInfoMutable bike)
|
/// <param name="nextAction">If not null next locking action which is performed after booking.</param>
|
||||||
|
public async Task DoBookAsync(Bikes.BikeInfoNS.BC.IBikeInfoMutable bike, LockingAction? nextAction = null)
|
||||||
{
|
{
|
||||||
if (bike == null)
|
if (bike == null)
|
||||||
{
|
{
|
||||||
|
@ -251,10 +252,11 @@ namespace TINK.Model.Connector
|
||||||
double batteryPercentage = btBike != null ? btBike.LockInfo.BatteryPercentage : double.NaN;
|
double batteryPercentage = btBike != null ? btBike.LockInfo.BatteryPercentage : double.NaN;
|
||||||
|
|
||||||
response = (await CopriServer.DoBookAsync(
|
response = (await CopriServer.DoBookAsync(
|
||||||
|
bike.OperatorUri,
|
||||||
bike.Id,
|
bike.Id,
|
||||||
guid,
|
guid,
|
||||||
batteryPercentage,
|
batteryPercentage,
|
||||||
bike.OperatorUri)).GetIsBookingResponseOk(bike.Id);
|
nextAction)).GetIsBookingResponseOk(bike.Id);
|
||||||
|
|
||||||
bike.Load(
|
bike.Load(
|
||||||
response,
|
response,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
|
@ -49,7 +49,8 @@ namespace TINK.Model.Connector
|
||||||
|
|
||||||
/// <summary> Request to book a bike.</summary>
|
/// <summary> Request to book a bike.</summary>
|
||||||
/// <param name="bike">Bike to book.</param>
|
/// <param name="bike">Bike to book.</param>
|
||||||
Task DoBook(Bikes.BikeInfoNS.BC.IBikeInfoMutable bike);
|
/// <param name="nextAction">If not null next locking action which is performed after booking.</param>
|
||||||
|
Task DoBookAsync(Bikes.BikeInfoNS.BC.IBikeInfoMutable bike, LockingAction? nextAction = null);
|
||||||
|
|
||||||
/// <summary> Request to book a bike and open its lock.</summary>
|
/// <summary> Request to book a bike and open its lock.</summary>
|
||||||
/// <param name="bike">Bike to book and to open lock for.</param>
|
/// <param name="bike">Bike to book and to open lock for.</param>
|
||||||
|
@ -163,4 +164,14 @@ namespace TINK.Model.Connector
|
||||||
|
|
||||||
public string Mail { get; }
|
public string Mail { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes a action to be performed with an lock.
|
||||||
|
/// </summary>
|
||||||
|
public enum LockingAction
|
||||||
|
{
|
||||||
|
Close,
|
||||||
|
Open,
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -662,6 +662,16 @@ namespace TINK.Model
|
||||||
AppResources.ChangeLog_PackageUpdates,
|
AppResources.ChangeLog_PackageUpdates,
|
||||||
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
|
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
new Version(3, 0, 355),
|
||||||
|
AppResources.ChangeLog_3_0_355_MK_SB_iOS,
|
||||||
|
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike },
|
||||||
|
new List<DevicePlatform> { DevicePlatform.iOS }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
new Version(3, 0, 356),
|
||||||
|
AppResources.ChangeLog3_0_231
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary> Manges the whats new information.</summary>
|
/// <summary> Manges the whats new information.</summary>
|
||||||
|
|
|
@ -738,6 +738,15 @@ namespace TINK.MultilingualResources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Bluetooth communication improved..
|
||||||
|
/// </summary>
|
||||||
|
public static string ChangeLog_3_0_355_MK_SB_iOS {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ChangeLog_3_0_355_MK_SB_iOS", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to We have fixed some bugs. Enjoy the ride!.
|
/// Looks up a localized string similar to We have fixed some bugs. Enjoy the ride!.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1111,4 +1111,7 @@ Probieren Sie es aus!</value>
|
||||||
<data name="ChangeLog_PackageUpdates" xml:space="preserve">
|
<data name="ChangeLog_PackageUpdates" xml:space="preserve">
|
||||||
<value>Softwarepakete wurden aktualisiert.</value>
|
<value>Softwarepakete wurden aktualisiert.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ChangeLog_3_0_355_MK_SB_iOS" xml:space="preserve">
|
||||||
|
<value>Bluetooth-Kommunikation verbessert.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1201,4 +1201,7 @@ Try it out!</value>
|
||||||
<data name="ChangeLog_PackageUpdates" xml:space="preserve">
|
<data name="ChangeLog_PackageUpdates" xml:space="preserve">
|
||||||
<value>Software packages were updated.</value>
|
<value>Software packages were updated.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ChangeLog_3_0_355_MK_SB_iOS" xml:space="preserve">
|
||||||
|
<value>Bluetooth communication improved.</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1520,6 +1520,10 @@ Probieren Sie es aus!</target>
|
||||||
<source>Software packages were updated.</source>
|
<source>Software packages were updated.</source>
|
||||||
<target state="translated">Softwarepakete wurden aktualisiert.</target>
|
<target state="translated">Softwarepakete wurden aktualisiert.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="ChangeLog_3_0_355_MK_SB_iOS" translate="yes" xml:space="preserve">
|
||||||
|
<source>Bluetooth communication improved.</source>
|
||||||
|
<target state="translated">Bluetooth-Kommunikation verbessert.</target>
|
||||||
|
</trans-unit>
|
||||||
</group>
|
</group>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
|
|
|
@ -7,6 +7,7 @@ using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Model.Logging;
|
using TINK.Model.Logging;
|
||||||
using TINK.Repository.Exception;
|
using TINK.Repository.Exception;
|
||||||
|
@ -181,19 +182,21 @@ namespace TINK.Repository
|
||||||
UserAgent);
|
UserAgent);
|
||||||
|
|
||||||
/// <summary> Gets booking request request. </summary>
|
/// <summary> Gets booking request request. </summary>
|
||||||
|
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
||||||
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
/// <param name="nextAction">If not null next locking action which is performed after booking.</param>
|
||||||
/// <returns>Requst on booking request.</returns>
|
/// <returns>Requst on booking request.</returns>
|
||||||
public async Task<ReservationBookingResponse> DoBookAsync(
|
public async Task<ReservationBookingResponse> DoBookAsync(
|
||||||
|
Uri operatorUri,
|
||||||
string bikeId,
|
string bikeId,
|
||||||
Guid guid,
|
Guid guid,
|
||||||
double batteryPercentage,
|
double batteryPercentage,
|
||||||
Uri operatorUri)
|
LockingAction? nextAction = null)
|
||||||
=> await DoBookAsync(
|
=> await DoBookAsync(
|
||||||
operatorUri?.AbsoluteUri ?? m_oCopriHost.AbsoluteUri,
|
operatorUri?.AbsoluteUri ?? m_oCopriHost.AbsoluteUri,
|
||||||
requestBuilder.DoBook(bikeId, guid, batteryPercentage),
|
requestBuilder.DoBook(bikeId, guid, batteryPercentage, nextAction),
|
||||||
UserAgent);
|
UserAgent);
|
||||||
|
|
||||||
/// <summary> Books a bike and starts opening bike. </summary>
|
/// <summary> Books a bike and starts opening bike. </summary>
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
@ -1640,7 +1641,7 @@ namespace TINK.Repository
|
||||||
double batteryLevel,
|
double batteryLevel,
|
||||||
IVersionInfo versionInfo) => null;
|
IVersionInfo versionInfo) => null;
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
public Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> null;
|
=> null;
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(
|
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MonkeyCache.FileStore;
|
using MonkeyCache.FileStore;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Model.Services.CopriApi;
|
using TINK.Model.Services.CopriApi;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
|
@ -176,7 +177,7 @@ namespace TINK.Repository
|
||||||
IVersionInfo versionInfo)
|
IVersionInfo versionInfo)
|
||||||
=> throw new System.Exception("Aktualisierung des Schlossstatuses im Offlinemodus nicht möglich!");
|
=> throw new System.Exception("Aktualisierung des Schlossstatuses im Offlinemodus nicht möglich!");
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
public Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> throw new System.Exception("Buchung im Offlinemodus nicht möglich!");
|
=> throw new System.Exception("Buchung im Offlinemodus nicht möglich!");
|
||||||
|
|
||||||
/// <summary> Books a bike and starts opening bike. </summary>
|
/// <summary> Books a bike and starts opening bike. </summary>
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
using TINK.Repository.Response;
|
using TINK.Repository.Response;
|
||||||
|
@ -74,16 +75,18 @@ namespace TINK.Repository
|
||||||
IVersionInfo versionInfo = null);
|
IVersionInfo versionInfo = null);
|
||||||
|
|
||||||
/// <summary> Books a bluetooth bike. </summary>
|
/// <summary> Books a bluetooth bike. </summary>
|
||||||
|
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
||||||
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
||||||
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
/// <param name="nextAction">If not null next locking action which is performed after booking.</param>
|
||||||
/// <returns>Response on booking request.</returns>
|
/// <returns>Response on booking request.</returns>
|
||||||
Task<ReservationBookingResponse> DoBookAsync(
|
Task<ReservationBookingResponse> DoBookAsync(
|
||||||
|
Uri operatorUri,
|
||||||
string bikeId,
|
string bikeId,
|
||||||
Guid guid,
|
Guid guid,
|
||||||
double batteryPercentage,
|
double batteryPercentage,
|
||||||
Uri operatorUri);
|
LockingAction? nextAction = null);
|
||||||
|
|
||||||
/// <summary> Books a bike and starts opening bike. </summary>
|
/// <summary> Books a bike and starts opening bike. </summary>
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
|
|
||||||
namespace TINK.Repository.Request
|
namespace TINK.Repository.Request
|
||||||
|
@ -79,8 +80,9 @@ namespace TINK.Repository.Request
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
||||||
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
||||||
|
/// <param name="nextAction">If not null next locking action which is performed after booking.</param>
|
||||||
/// <returns>Request to booking bike.</returns>
|
/// <returns>Request to booking bike.</returns>
|
||||||
string DoBook(string bikeId, Guid guid, double batteryPercentage);
|
string DoBook(string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null);
|
||||||
|
|
||||||
/// <summary> Gets the request to book and start opening the bike (synonym: booking == renting == mieten). </summary>
|
/// <summary> Gets the request to book and start opening the bike (synonym: booking == renting == mieten). </summary>
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Repository.Exception;
|
using TINK.Repository.Exception;
|
||||||
|
|
||||||
|
@ -109,7 +110,7 @@ namespace TINK.Repository.Request
|
||||||
public string UpateLockingState(string bikeId, lock_state state, LocationDto geolocation, double batteryPercentage, IVersionInfo versionInfo)
|
public string UpateLockingState(string bikeId, lock_state state, LocationDto geolocation, double batteryPercentage, IVersionInfo versionInfo)
|
||||||
=> throw new NotSupportedException();
|
=> throw new NotSupportedException();
|
||||||
|
|
||||||
public string DoBook(string bikeId, Guid guid, double batteryPercentage)
|
public string DoBook(string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> throw new NotSupportedException();
|
=> throw new NotSupportedException();
|
||||||
|
|
||||||
/// <summary> Gets the request to book and start opening the bike (synonym: booking == renting == mieten). </summary>
|
/// <summary> Gets the request to book and start opening the bike (synonym: booking == renting == mieten). </summary>
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
using TINK.Model.Connector;
|
||||||
|
|
||||||
namespace TINK.Repository.Request
|
namespace TINK.Repository.Request
|
||||||
{
|
{
|
||||||
public static class RequestBuilderHelper
|
public static class RequestBuilderHelper
|
||||||
|
@ -12,5 +14,20 @@ namespace TINK.Repository.Request
|
||||||
=> !string.IsNullOrEmpty(uiIsoLangugageName)
|
=> !string.IsNullOrEmpty(uiIsoLangugageName)
|
||||||
? $"&lang={uiIsoLangugageName}"
|
? $"&lang={uiIsoLangugageName}"
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
|
|
||||||
|
public static lock_state? GetLockState(this LockingAction? action)
|
||||||
|
{
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case LockingAction.Open:
|
||||||
|
return lock_state.unlocking;
|
||||||
|
|
||||||
|
case LockingAction.Close:
|
||||||
|
return lock_state.locking;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Repository.Exception;
|
using TINK.Repository.Exception;
|
||||||
using TINK.Services.Logging;
|
using TINK.Services.Logging;
|
||||||
|
@ -153,14 +154,15 @@ namespace TINK.Repository.Request
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
||||||
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
||||||
|
/// <param name="nextAction">If not null next locking action which is performed after booking.</param>
|
||||||
/// <returns>Request to booking bike.</returns>
|
/// <returns>Request to booking bike.</returns>
|
||||||
public string DoBook(string bikeId, Guid guid, double batteryPercentage)
|
public string DoBook(string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> "request=booking_update" +
|
=> "request=booking_update" +
|
||||||
GetBikeIdParameter(bikeId) +
|
GetBikeIdParameter(bikeId) +
|
||||||
AuthCookieParameter +
|
AuthCookieParameter +
|
||||||
$"&Ilockit_GUID={guid}" +
|
$"&Ilockit_GUID={guid}" +
|
||||||
"&state=occupied" +
|
"&state=occupied" +
|
||||||
GetLockStateParameter(lock_state.unlocked) +
|
GetLockStateParameter(nextAction.GetLockState()) +
|
||||||
GetBatteryPercentageParameters(batteryPercentage) +
|
GetBatteryPercentageParameters(batteryPercentage) +
|
||||||
UiIsoLanguageNameParameter;
|
UiIsoLanguageNameParameter;
|
||||||
|
|
||||||
|
@ -269,9 +271,12 @@ namespace TINK.Repository.Request
|
||||||
private static string GetBikeIdParameter(string bikeId)
|
private static string GetBikeIdParameter(string bikeId)
|
||||||
=> $"&bike={bikeId}";
|
=> $"&bike={bikeId}";
|
||||||
|
|
||||||
private static string GetLockStateParameter(lock_state lockState)
|
private static string GetLockStateParameter(lock_state? lockState)
|
||||||
=> $"&lock_state={lockState}";
|
=> lockState.HasValue ? $"&lock_state={lockState}" : string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the battery level percentage parameter if percentage is not NaN an empty string otherwise.
|
||||||
|
/// </summary>
|
||||||
private static string GetBatteryPercentageParameters(double batteryPercentage) => !double.IsNaN(batteryPercentage)
|
private static string GetBatteryPercentageParameters(double batteryPercentage) => !double.IsNaN(batteryPercentage)
|
||||||
? $"&voltage={batteryPercentage.ToString(CultureInfo.InvariantCulture)}"
|
? $"&voltage={batteryPercentage.ToString(CultureInfo.InvariantCulture)}"
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Connector.Updater;
|
using TINK.Model.Connector.Updater;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Repository;
|
using TINK.Repository;
|
||||||
|
@ -243,12 +244,14 @@ namespace TINK.Model.Services.CopriApi
|
||||||
versionInfo);
|
versionInfo);
|
||||||
|
|
||||||
/// <summary> Books a bike. </summary>
|
/// <summary> Books a bike. </summary>
|
||||||
|
/// <param name="operatorUri">Holds the uri of the operator or null, in case of single operator setup.</param>
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
/// <param name="guid">Used to publish GUID from app to copri. Used for initial setup of bike in copri.</param>
|
||||||
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
/// <param name="batteryPercentage">Holds the filling level percentage of the battery.</param>
|
||||||
|
/// <param name="nextAction">If not null next locking action which is performed after booking.</param>
|
||||||
/// <returns>Response on booking request.</returns>
|
/// <returns>Response on booking request.</returns>
|
||||||
public async Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
public async Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> await HttpsServer.DoBookAsync(bikeId, guid, batteryPercentage, operatorUri);
|
=> await HttpsServer.DoBookAsync(operatorUri, bikeId, guid, batteryPercentage, nextAction);
|
||||||
|
|
||||||
/// <summary> Books a bike and starts opening bike. </summary>
|
/// <summary> Books a bike and starts opening bike. </summary>
|
||||||
/// <param name="bikeId">Id of the bike to book.</param>
|
/// <param name="bikeId">Id of the bike to book.</param>
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Repository;
|
using TINK.Repository;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
|
@ -65,8 +66,8 @@ namespace TINK.Model.Services.CopriApi
|
||||||
batteryLevel,
|
batteryLevel,
|
||||||
versionInfo);
|
versionInfo);
|
||||||
|
|
||||||
public async Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
public async Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> await monkeyStore.DoBookAsync(bikeId, guid, batteryPercentage, operatorUri);
|
=> await monkeyStore.DoBookAsync(operatorUri, bikeId, guid, batteryPercentage, nextAction);
|
||||||
|
|
||||||
public async Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(
|
public async Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(
|
||||||
string bikeId,
|
string bikeId,
|
||||||
|
|
|
@ -222,7 +222,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
IsConnected = IsConnectedDelegate();
|
IsConnected = IsConnectedDelegate();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ConnectorFactory(IsConnected).Command.DoBook(SelectedBike);
|
await ConnectorFactory(IsConnected).Command.DoBookAsync(SelectedBike, LockingAction.Open);
|
||||||
}
|
}
|
||||||
catch (Exception l_oException)
|
catch (Exception l_oException)
|
||||||
{
|
{
|
||||||
|
|
|
@ -194,7 +194,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
IsConnected = IsConnectedDelegate();
|
IsConnected = IsConnectedDelegate();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ConnectorFactory(IsConnected).Command.DoBook(SelectedBike);
|
await ConnectorFactory(IsConnected).Command.DoBookAsync(SelectedBike);
|
||||||
}
|
}
|
||||||
catch (Exception l_oException)
|
catch (Exception l_oException)
|
||||||
{
|
{
|
||||||
|
|
|
@ -187,7 +187,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
IsConnected = IsConnectedDelegate();
|
IsConnected = IsConnectedDelegate();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ConnectorFactory(IsConnected).Command.DoBook(SelectedBike);
|
await ConnectorFactory(IsConnected).Command.DoBookAsync(SelectedBike, LockingAction.Open);
|
||||||
}
|
}
|
||||||
catch (Exception l_oException)
|
catch (Exception l_oException)
|
||||||
{
|
{
|
||||||
|
|
|
@ -350,7 +350,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
IsConnected = IsConnectedDelegate();
|
IsConnected = IsConnectedDelegate();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ConnectorFactory(IsConnected).Command.DoBook(SelectedBike);
|
await ConnectorFactory(IsConnected).Command.DoBookAsync(SelectedBike, LockingAction.Open);
|
||||||
}
|
}
|
||||||
catch (Exception l_oException)
|
catch (Exception l_oException)
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
IsConnected = IsConnectedDelegate();
|
IsConnected = IsConnectedDelegate();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await ConnectorFactory(IsConnected).Command.DoBook(SelectedBike);
|
await ConnectorFactory(IsConnected).Command.DoBookAsync(SelectedBike);
|
||||||
}
|
}
|
||||||
catch (Exception l_oException)
|
catch (Exception l_oException)
|
||||||
{
|
{
|
||||||
|
|
|
@ -858,98 +858,6 @@ namespace TINK.ViewModel.Map
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Command object to bind CurrentLocation Button to view model.</summary>
|
|
||||||
public System.Windows.Input.ICommand OnCurrentLocationButtonClicked => new Xamarin.Forms.Command(async () => await CenterToCurrentLocation());
|
|
||||||
|
|
||||||
/// <summary> User request to center to currentLocation. </summary>
|
|
||||||
public async Task CenterToCurrentLocation()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ActionText = AppResources.ActivityTextCenterMap;
|
|
||||||
|
|
||||||
IsMapPageEnabled = false;
|
|
||||||
|
|
||||||
Log.ForContext<MapPageViewModel>().Information($"Request to center to current position.");
|
|
||||||
|
|
||||||
// Stop polling.
|
|
||||||
//ActionText = AppResources.ActivityTextOneMomentPlease;
|
|
||||||
await m_oViewUpdateManager.StopUpdatePeridically();
|
|
||||||
|
|
||||||
// Clear error info.
|
|
||||||
Exception = null;
|
|
||||||
|
|
||||||
ActiveFilterMap = tinkKonradToggleViewModel.FilterDictionary;
|
|
||||||
TinkApp.GroupFilterMapPage = ActiveFilterMap;
|
|
||||||
TinkApp.Save();
|
|
||||||
|
|
||||||
TinkApp.UpdateConnector();
|
|
||||||
|
|
||||||
// Check location permission
|
|
||||||
var status = await RequestLocationPermission();
|
|
||||||
if (status == Status.Granted)
|
|
||||||
{
|
|
||||||
// Move and scale.
|
|
||||||
Location currentLocation = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
currentLocation = await GeolocationService.GetAsync();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentLocation != null)
|
|
||||||
{
|
|
||||||
ActionText = AppResources.ActivityTextCenterMap;
|
|
||||||
|
|
||||||
TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius(
|
|
||||||
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
|
|
||||||
TinkApp.ActiveMapSpan.Radius);
|
|
||||||
|
|
||||||
TinkApp.Save();
|
|
||||||
|
|
||||||
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Update bikes at station or my bikes depending on context.
|
|
||||||
await m_oViewUpdateManager.StartUpdateAyncPeridically(Polling);
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
// Excpetions are handled insde update task;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await ViewService.DisplayAlert(
|
|
||||||
AppResources.MessageTitleHint,
|
|
||||||
AppResources.MessageErrorLocationIsOff,
|
|
||||||
AppResources.MessageAnswerOk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IsMapPageEnabled = true;
|
|
||||||
Log.ForContext<MapPageViewModel>().Information($"Center to current Position done.");
|
|
||||||
ActionText = String.Empty;
|
|
||||||
}
|
|
||||||
catch (Exception l_oException)
|
|
||||||
{
|
|
||||||
Log.ForContext<MapPageViewModel>().Error("An error occurred while centering to current position.");
|
|
||||||
ActionText = String.Empty;
|
|
||||||
|
|
||||||
await ViewService.DisplayAlert(
|
|
||||||
"Fehler",
|
|
||||||
AppResources.MessageMapPageErrorSwitch,
|
|
||||||
String.Format(AppResources.MessageErrorQueryLocationMessage, l_oException.Message),
|
|
||||||
AppResources.MessageAnswerOk);
|
|
||||||
|
|
||||||
IsMapPageEnabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary> Command object to bind login button to view model.</summary>
|
/// <summary> Command object to bind login button to view model.</summary>
|
||||||
public System.Windows.Input.ICommand OnToggleTinkToKonrad => new Xamarin.Forms.Command(async () => await ToggleTinkToKonrad());
|
public System.Windows.Input.ICommand OnToggleTinkToKonrad => new Xamarin.Forms.Command(async () => await ToggleTinkToKonrad());
|
||||||
|
|
||||||
|
@ -1015,43 +923,6 @@ namespace TINK.ViewModel.Map
|
||||||
|
|
||||||
Pins.Clear();
|
Pins.Clear();
|
||||||
|
|
||||||
//// Move and scale before getting stations and bikes which takes some time.
|
|
||||||
//if (TinkApp.CenterMapToCurrentLocation)
|
|
||||||
//{
|
|
||||||
// // Check location permission
|
|
||||||
// //ActionText = AppResources.ActivityTextRequestingLocationPermissions;
|
|
||||||
// var status = await RequestLocationPermission();
|
|
||||||
// if (status == Status.Granted)
|
|
||||||
// {
|
|
||||||
// //ActionText = AppResources.ActivityTextCenterMap;
|
|
||||||
|
|
||||||
// Location currentLocation = null;
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// currentLocation = await GeolocationService.GetAsync();
|
|
||||||
// }
|
|
||||||
// catch (Exception ex)
|
|
||||||
// {
|
|
||||||
// Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (currentLocation != null)
|
|
||||||
// {
|
|
||||||
// TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius(
|
|
||||||
// new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
|
|
||||||
// TinkApp.ActiveMapSpan.Radius);
|
|
||||||
|
|
||||||
// TinkApp.Save();
|
|
||||||
|
|
||||||
// //MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// ActionText = AppResources.ActivityTextErrorQueryLocationWhenAny;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
// Update stations
|
// Update stations
|
||||||
ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes;
|
ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes;
|
||||||
IsConnected = TinkApp.GetIsConnected();
|
IsConnected = TinkApp.GetIsConnected();
|
||||||
|
|
|
@ -5,6 +5,7 @@ using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model;
|
using TINK.Model;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Repository;
|
using TINK.Repository;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
|
@ -263,7 +264,7 @@ namespace TestFramework.Repository
|
||||||
IVersionInfo versionInfo)
|
IVersionInfo versionInfo)
|
||||||
=> null;
|
=> null;
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
public Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> null;
|
=> null;
|
||||||
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
||||||
=> null;
|
=> null;
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Repository;
|
using TINK.Repository;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
|
@ -64,7 +65,7 @@ namespace TestFramework.Repository
|
||||||
IVersionInfo versionInfo)
|
IVersionInfo versionInfo)
|
||||||
=> throw new NotImplementedException();
|
=> throw new NotImplementedException();
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
public Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> throw new NotImplementedException();
|
=> throw new NotImplementedException();
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TestFramework.Repository;
|
using TestFramework.Repository;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Model.Services.CopriApi;
|
using TINK.Model.Services.CopriApi;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
|
@ -84,7 +85,7 @@ namespace TestFramework.Services.CopriApi.Connector
|
||||||
IVersionInfo versionInfo)
|
IVersionInfo versionInfo)
|
||||||
=> throw new NotImplementedException();
|
=> throw new NotImplementedException();
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
public Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> throw new NotImplementedException();
|
=> throw new NotImplementedException();
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
||||||
|
|
36
TestShareeLib/Repository/Request/TestRequestBuilderHelper.cs
Normal file
36
TestShareeLib/Repository/Request/TestRequestBuilderHelper.cs
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using TINK.Model.Connector;
|
||||||
|
using TINK.Repository.Request;
|
||||||
|
|
||||||
|
namespace TestShareeLib.Repository.Request
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class TestRequestBuilderHelper
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void TestGetLockStateNull()
|
||||||
|
=> Assert.That(
|
||||||
|
RequestBuilderHelper.GetLockState(null),
|
||||||
|
Is.Null);
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestGetLockState([Values] LockingAction action)
|
||||||
|
{
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case LockingAction.Open:
|
||||||
|
case LockingAction.Close:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new ArgumentException("Tests need possibly exended.");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.That(
|
||||||
|
RequestBuilderHelper.GetLockState(action),
|
||||||
|
Is.EqualTo(action == LockingAction.Open ? lock_state.unlocking : lock_state.locking));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Repository.Exception;
|
using TINK.Repository.Exception;
|
||||||
using TINK.Repository.Request;
|
using TINK.Repository.Request;
|
||||||
|
|
||||||
|
@ -117,18 +118,35 @@ namespace TestShareeLib.Repository.Request
|
||||||
public void TestDoBook()
|
public void TestDoBook()
|
||||||
{
|
{
|
||||||
Assert.AreEqual(
|
Assert.AreEqual(
|
||||||
"request=booking_update&bike=42&authcookie=456123&Ilockit_GUID=0000f00d-1212-efde-1523-785fef13d123&state=occupied&lock_state=unlocked&voltage=33.21",
|
"request=booking_update&bike=42&authcookie=456123&Ilockit_GUID=0000f00d-1212-efde-1523-785fef13d123&state=occupied&lock_state=unlocking&voltage=33.21",
|
||||||
new RequestBuilderLoggedIn("123", null /*UI language */, "456").DoBook("42", new Guid("0000f00d-1212-efde-1523-785fef13d123"), 33.21));
|
new RequestBuilderLoggedIn("123", null /*UI language */, "456").DoBook("42", new Guid("0000f00d-1212-efde-1523-785fef13d123"), 33.21, LockingAction.Open));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDoBookNoBatery()
|
public void TestDoBookNoBatery()
|
||||||
{
|
{
|
||||||
Assert.AreEqual(
|
Assert.AreEqual(
|
||||||
"request=booking_update&bike=42&authcookie=456123&Ilockit_GUID=0000f00d-1212-efde-1523-785fef13d123&state=occupied&lock_state=unlocked",
|
"request=booking_update&bike=42&authcookie=456123&Ilockit_GUID=0000f00d-1212-efde-1523-785fef13d123&state=occupied",
|
||||||
new RequestBuilderLoggedIn("123", null /*UI language */, "456").DoBook("42", new Guid("0000f00d-1212-efde-1523-785fef13d123"), double.NaN));
|
new RequestBuilderLoggedIn("123", null /*UI language */, "456").DoBook("42", new Guid("0000f00d-1212-efde-1523-785fef13d123"), double.NaN));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestDoBookActionNone()
|
||||||
|
{
|
||||||
|
Assert.AreEqual(
|
||||||
|
"request=booking_update&bike=42&authcookie=456123&Ilockit_GUID=0000f00d-1212-efde-1523-785fef13d123&state=occupied",
|
||||||
|
new RequestBuilderLoggedIn("123", null /*UI language */, "456").DoBook("42", new Guid("0000f00d-1212-efde-1523-785fef13d123"), double.NaN));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary> Hypothetical scenario.</summary>
|
||||||
|
[Test]
|
||||||
|
public void TestDoBookActionClose()
|
||||||
|
{
|
||||||
|
Assert.AreEqual(
|
||||||
|
"request=booking_update&bike=42&authcookie=456123&Ilockit_GUID=0000f00d-1212-efde-1523-785fef13d123&state=occupied&lock_state=locking",
|
||||||
|
new RequestBuilderLoggedIn("123", null /*UI language */, "456").DoBook("42", new Guid("0000f00d-1212-efde-1523-785fef13d123"), double.NaN, LockingAction.Close));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestBookAndStartOpening()
|
public void TestBookAndStartOpening()
|
||||||
=> Assert.That(
|
=> Assert.That(
|
||||||
|
|
|
@ -157,7 +157,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
locks.ConnectAsync(Arg.Any<LockInfoAuthTdo>(), Arg.Any<TimeSpan>());
|
locks.ConnectAsync(Arg.Any<LockInfoAuthTdo>(), Arg.Any<TimeSpan>());
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
|
|
|
@ -281,7 +281,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
locks[0].GetBatteryPercentageAsync();
|
locks[0].GetBatteryPercentageAsync();
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike);
|
connector.Command.DoBookAsync(bike);
|
||||||
bikesViewModel.ActionText = "Updating...";
|
bikesViewModel.ActionText = "Updating...";
|
||||||
pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again
|
pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
|
@ -328,7 +328,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
|
|
||||||
viewService.DisplayAlert(string.Empty, "Fahrrad Nr. 0 mieten oder Schloss schließen?", "Mieten", "Schloss schließen").Returns(Task.FromResult(true));
|
viewService.DisplayAlert(string.Empty, "Fahrrad Nr. 0 mieten oder Schloss schließen?", "Mieten", "Schloss schließen").Returns(Task.FromResult(true));
|
||||||
|
|
||||||
connector.Command.DoBook(bike).Returns(x => throw new WebConnectFailureException("Context info.", new Exception("chub")));
|
connector.Command.DoBookAsync(bike).Returns(x => throw new WebConnectFailureException("Context info.", new Exception("chub")));
|
||||||
|
|
||||||
locks[0].CloseAsync().Returns(Task.FromResult((LockitLockingState?)LockitLockingState.Closed));
|
locks[0].CloseAsync().Returns(Task.FromResult((LockitLockingState?)LockitLockingState.Closed));
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
locks[0].GetBatteryPercentageAsync();
|
locks[0].GetBatteryPercentageAsync();
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike);
|
connector.Command.DoBookAsync(bike);
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
viewService.DisplayAlert(
|
viewService.DisplayAlert(
|
||||||
"Connection error when renting the bike!",
|
"Connection error when renting the bike!",
|
||||||
|
@ -401,7 +401,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
|
|
||||||
viewService.DisplayAlert(string.Empty, "Fahrrad Nr. 0 mieten oder Schloss schließen?", "Mieten", "Schloss schließen").Returns(Task.FromResult(true));
|
viewService.DisplayAlert(string.Empty, "Fahrrad Nr. 0 mieten oder Schloss schließen?", "Mieten", "Schloss schließen").Returns(Task.FromResult(true));
|
||||||
|
|
||||||
connector.Command.DoBook(bike).Returns(x => throw new Exception("Exception message."));
|
connector.Command.DoBookAsync(bike).Returns(x => throw new Exception("Exception message."));
|
||||||
|
|
||||||
locks[0].CloseAsync().Returns(Task.FromResult((LockitLockingState?)LockitLockingState.Closed));
|
locks[0].CloseAsync().Returns(Task.FromResult((LockitLockingState?)LockitLockingState.Closed));
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
locks[0].GetBatteryPercentageAsync();
|
locks[0].GetBatteryPercentageAsync();
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike);
|
connector.Command.DoBookAsync(bike);
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
viewService.DisplayAlert("Error when renting the bike!", "Attention: Lock is closed!\r\nException message.", "OK");
|
viewService.DisplayAlert("Error when renting the bike!", "Attention: Lock is closed!\r\nException message.", "OK");
|
||||||
bikesViewModel.ActionText = "Verschließe Schloss...";
|
bikesViewModel.ActionText = "Verschließe Schloss...";
|
||||||
|
|
|
@ -472,7 +472,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
|
@ -528,7 +528,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
|
|
||||||
bike.LockInfo.State.Returns(LockingState.Closed); // Locking state does not change.
|
bike.LockInfo.State.Returns(LockingState.Closed); // Locking state does not change.
|
||||||
|
|
||||||
connector.Command.DoBook(bike).Returns(x => throw new WebConnectFailureException("Context info", new Exception("Tst")));
|
connector.Command.DoBookAsync(bike, LockingAction.Open).Returns(x => throw new WebConnectFailureException("Context info", new Exception("Tst")));
|
||||||
|
|
||||||
bike.State.Value.Returns(InUseStateEnum.Reserved); // State remains reserved because booking request failed.
|
bike.State.Value.Returns(InUseStateEnum.Reserved); // State remains reserved because booking request failed.
|
||||||
|
|
||||||
|
@ -541,7 +541,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
viewService.DisplayAdvancedAlert(
|
viewService.DisplayAdvancedAlert(
|
||||||
"Connection error when renting the bike!",
|
"Connection error when renting the bike!",
|
||||||
|
@ -597,7 +597,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
|
|
||||||
bike.LockInfo.State.Returns(LockingState.Closed); // Locking state does not change.
|
bike.LockInfo.State.Returns(LockingState.Closed); // Locking state does not change.
|
||||||
|
|
||||||
connector.Command.DoBook(bike).Returns(x => throw new Exception("Exception message."));
|
connector.Command.DoBookAsync(bike, LockingAction.Open).Returns(x => throw new Exception("Exception message."));
|
||||||
|
|
||||||
bike.State.Value.Returns(InUseStateEnum.Reserved); // When booking fails state remains reserved.
|
bike.State.Value.Returns(InUseStateEnum.Reserved); // When booking fails state remains reserved.
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
viewService.DisplayAdvancedAlert(
|
viewService.DisplayAdvancedAlert(
|
||||||
"Error when renting the bike!",
|
"Error when renting the bike!",
|
||||||
|
@ -679,7 +679,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
|
@ -746,7 +746,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
|
@ -812,7 +812,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "Updating...";
|
bikesViewModel.ActionText = "Updating...";
|
||||||
|
@ -878,7 +878,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
|
@ -949,7 +949,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
|
@ -1020,7 +1020,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
|
@ -1091,7 +1091,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
|
@ -1163,7 +1163,7 @@ namespace TestShareeLib.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
||||||
bikesViewModel.ActionText = "One moment please...";
|
bikesViewModel.ActionText = "One moment please...";
|
||||||
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
pollingManager.StopUpdatePeridically(); // Polling must be stopped before any COPR and lock service action
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
|
|
|
@ -422,7 +422,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
locks.ConnectAsync(Arg.Any<LockInfoAuthTdo>(), Arg.Any<TimeSpan>());
|
locks.ConnectAsync(Arg.Any<LockInfoAuthTdo>(), Arg.Any<TimeSpan>());
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike); // Booking must be performed
|
connector.Command.DoBookAsync(bike, LockingAction.Open); // Booking must be performed
|
||||||
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
bikesViewModel.ActionText = "<h4><b>Lock is opening.<br/>Please wait until it is completely open.</b></h4>";
|
||||||
locks.Received()[0].OpenAsync(); // Lock must be opened
|
locks.Received()[0].OpenAsync(); // Lock must be opened
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
locks[0].GetBatteryPercentageAsync();
|
locks[0].GetBatteryPercentageAsync();
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike);
|
connector.Command.DoBookAsync(bike);
|
||||||
bikesViewModel.ActionText = "Updating...";
|
bikesViewModel.ActionText = "Updating...";
|
||||||
pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again
|
pollingManager.StartUpdateAyncPeridically(); // polling must be restarted again
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
|
@ -139,7 +139,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
|
|
||||||
viewService.DisplayAlert(string.Empty, "Rad Nr. 0 abschließen und zurückgeben oder Rad mieten?", "Zurückgeben", "Mieten").Returns(Task.FromResult(false));
|
viewService.DisplayAlert(string.Empty, "Rad Nr. 0 abschließen und zurückgeben oder Rad mieten?", "Zurückgeben", "Mieten").Returns(Task.FromResult(false));
|
||||||
|
|
||||||
connector.Command.DoBook(bike).Returns(x => throw new WebConnectFailureException("Context info.", new Exception("Tst")));
|
connector.Command.DoBookAsync(bike).Returns(x => throw new WebConnectFailureException("Context info.", new Exception("Tst")));
|
||||||
|
|
||||||
locks[0].CloseAsync().Returns(LockitLockingState.Closed);
|
locks[0].CloseAsync().Returns(LockitLockingState.Closed);
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
locks[0].GetBatteryPercentageAsync();
|
locks[0].GetBatteryPercentageAsync();
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike);
|
connector.Command.DoBookAsync(bike);
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
viewService.DisplayAlert(
|
viewService.DisplayAlert(
|
||||||
"Connection error when renting the bike!",
|
"Connection error when renting the bike!",
|
||||||
|
@ -208,7 +208,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
|
|
||||||
viewService.DisplayAlert(string.Empty, "Rad Nr. 0 abschließen und zurückgeben oder Rad mieten?", "Zurückgeben", "Mieten").Returns(Task.FromResult(false));
|
viewService.DisplayAlert(string.Empty, "Rad Nr. 0 abschließen und zurückgeben oder Rad mieten?", "Zurückgeben", "Mieten").Returns(Task.FromResult(false));
|
||||||
|
|
||||||
connector.Command.DoBook(bike).Returns(x => throw new Exception("Exception message."));
|
connector.Command.DoBookAsync(bike).Returns(x => throw new Exception("Exception message."));
|
||||||
|
|
||||||
locks[0].CloseAsync().Returns(LockitLockingState.Closed);
|
locks[0].CloseAsync().Returns(LockitLockingState.Closed);
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel.Bikes.Bike.BluetoothLock.Re
|
||||||
bikesViewModel.ActionText = "Reading charging level...";
|
bikesViewModel.ActionText = "Reading charging level...";
|
||||||
locks[0].GetBatteryPercentageAsync();
|
locks[0].GetBatteryPercentageAsync();
|
||||||
bikesViewModel.ActionText = "Renting bike...";
|
bikesViewModel.ActionText = "Renting bike...";
|
||||||
connector.Command.DoBook(bike);
|
connector.Command.DoBookAsync(bike);
|
||||||
bikesViewModel.ActionText = "";
|
bikesViewModel.ActionText = "";
|
||||||
viewService.DisplayAlert("Error when renting the bike!", "Attention: Lock is closed!\r\nException message.", "OK");
|
viewService.DisplayAlert("Error when renting the bike!", "Attention: Lock is closed!\r\nException message.", "OK");
|
||||||
bikesViewModel.ActionText = "Wiederverschließe Schloss...";
|
bikesViewModel.ActionText = "Wiederverschließe Schloss...";
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
|
||||||
|
using TINK.Model.Connector;
|
||||||
using TINK.Model.Device;
|
using TINK.Model.Device;
|
||||||
using TINK.Model.Services.CopriApi;
|
using TINK.Model.Services.CopriApi;
|
||||||
using TINK.Repository;
|
using TINK.Repository;
|
||||||
|
@ -89,7 +90,7 @@ namespace TestTINKLib.Mocks.Connector
|
||||||
IVersionInfo versionInfo)
|
IVersionInfo versionInfo)
|
||||||
=> throw new NotImplementedException();
|
=> throw new NotImplementedException();
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
public Task<ReservationBookingResponse> DoBookAsync(Uri operatorUri, string bikeId, Guid guid, double batteryPercentage, LockingAction? nextAction = null)
|
||||||
=> throw new NotImplementedException();
|
=> throw new NotImplementedException();
|
||||||
|
|
||||||
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
public Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(string bikeId, Uri operatorUri)
|
||||||
|
|
Loading…
Reference in a new issue