Version 3.0.261
|
@ -1,5 +1,5 @@
|
|||
<?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.260" android:versionCode="260">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.LastenradBayern" android:versionName="3.0.261" android:versionCode="261">
|
||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
|
||||
<!-- Google Maps related permissions -->
|
||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
using Xamarin.Forms;
|
||||
|
||||
|
|
|
@ -48,9 +48,9 @@
|
|||
<string>com.TeilRad.LastenradBayern</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>LastenradBayern</string>
|
||||
<key>CFBundleVersion</key>.?
|
||||
<string>260</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>261</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.0.259</string>
|
||||
<string>3.0.261</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 10 KiB |
|
@ -21,7 +21,8 @@
|
|||
<rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.20392156862745098" green="0.4983606557377049180327868852459" blue="0.5016393442622950819672131147541" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<!--Color # -->
|
||||
<color key="backgroundColor" red="0.0" green="0.596078431372549" blue="0,6" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="23" firstAttribute="centerY" secondItem="yd7-JS-zBw" secondAttribute="centerY" priority="1" id="39"/>
|
||||
<constraint firstItem="23" firstAttribute="centerX" secondItem="yd7-JS-zBw" secondAttribute="centerX" priority="1" id="41"/>
|
||||
|
|
|
@ -94,6 +94,7 @@ namespace TINK
|
|||
JsonSettingsDictionary.GetConnectTimeout(settingsJSON),
|
||||
JsonSettingsDictionary.GetActiveGeolocationService(settingsJSON),
|
||||
JsonSettingsDictionary.GetCenterMapToCurrentLocation(settingsJSON),
|
||||
Xamarin.Forms.GoogleMaps.MapSpan.FromCenterAndRadius(new Xamarin.Forms.GoogleMaps.Position(49.30881083492271, 11.358449625922889), Xamarin.Forms.GoogleMaps.Distance.FromKilometers(2.9)),
|
||||
JsonSettingsDictionary.GetLogToExternalFolder(settingsJSON),
|
||||
JsonSettingsDictionary.GetIsSiteCachingOn(settingsJSON),
|
||||
JsonSettingsDictionary.GetActiveTheme(settingsJSON) ?? typeof(Themes.LastenradBayern).FullName);
|
||||
|
|
|
@ -204,8 +204,7 @@ namespace TINK.View.Map
|
|||
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
|
||||
MapPageViewModel.MoveAndScale(
|
||||
(mapSpan) => MyMap.MoveToRegion(mapSpan),
|
||||
App.ModelRoot.Uris.ActiveUri,
|
||||
App.ModelRoot.GroupFilterMapPage);
|
||||
App.ModelRoot.MapSpan);
|
||||
}
|
||||
catch(Exception exception)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?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.260" android:versionCode="260">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.Meinkonrad" android:versionName="3.0.261" android:versionCode="261">
|
||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
|
||||
<!-- Google Maps related permissions -->
|
||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
using Xamarin.Forms;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<key>XSLaunchImageAssets</key>
|
||||
<string>Media.xcassets/LaunchImages.launchimage</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>TINK</string>
|
||||
<string>Meinkonrad</string>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Media.xcassets/AppIcons.appiconset</string>
|
||||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
|
@ -48,9 +48,9 @@
|
|||
<string>com.TeilRad.Meinkonrad</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Mein konrad</string>
|
||||
<key>CFBundleVersion</key>.?
|
||||
<string>260</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>261</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.0.259</string>
|
||||
<string>3.0.261</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -232,8 +232,6 @@
|
|||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<ITunesArtwork Include="iTunesArtwork" />
|
||||
<ITunesArtwork Include="iTunesArtwork@2x" />
|
||||
<Compile Include="Device\AppInfo.cs" />
|
||||
<Compile Include="Device\ExternalBrowseService.cs" />
|
||||
<EmbeddedResource Include="Resources\Font Awesome 5 Free-Solid-900.otf" />
|
||||
|
@ -1603,6 +1601,10 @@
|
|||
<Folder Include="Media.xcassets\Open_LightBlue.imageset\" />
|
||||
<Folder Include="Media.xcassets\Open_Red.imageset\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ITunesArtwork Include="iTunesArtwork%402x" />
|
||||
<ITunesArtwork Include="iTunesArtwork" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\TINK\Meinkonrad.projitems" Label="Shared" Condition="Exists('..\TINK\Meinkonrad.projitems')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 26 KiB |
|
@ -21,7 +21,8 @@
|
|||
<rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.20392156862745098" green="0.4983606557377049180327868852459" blue="0.5016393442622950819672131147541" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<!--Color # -->
|
||||
<color key="backgroundColor" red="1.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="23" firstAttribute="centerY" secondItem="yd7-JS-zBw" secondAttribute="centerY" priority="1" id="39"/>
|
||||
<constraint firstItem="23" firstAttribute="centerX" secondItem="yd7-JS-zBw" secondAttribute="centerX" priority="1" id="41"/>
|
||||
|
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 225 KiB |
|
@ -93,6 +93,7 @@ namespace TINK
|
|||
JsonSettingsDictionary.GetConnectTimeout(settingsJSON),
|
||||
JsonSettingsDictionary.GetActiveGeolocationService(settingsJSON),
|
||||
JsonSettingsDictionary.GetCenterMapToCurrentLocation(settingsJSON),
|
||||
Xamarin.Forms.GoogleMaps.MapSpan.FromCenterAndRadius(new Xamarin.Forms.GoogleMaps.Position(47.680, 9.180), Xamarin.Forms.GoogleMaps.Distance.FromKilometers(2.9)),
|
||||
JsonSettingsDictionary.GetLogToExternalFolder(settingsJSON),
|
||||
JsonSettingsDictionary.GetIsSiteCachingOn(settingsJSON),
|
||||
JsonSettingsDictionary.GetActiveTheme(settingsJSON) ?? typeof(Themes.Konrad).FullName);
|
||||
|
|
|
@ -204,8 +204,7 @@ namespace TINK.View.Map
|
|||
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
|
||||
MapPageViewModel.MoveAndScale(
|
||||
(mapSpan) => MyMap.MoveToRegion(mapSpan),
|
||||
App.ModelRoot.Uris.ActiveUri,
|
||||
App.ModelRoot.GroupFilterMapPage);
|
||||
App.ModelRoot.MapSpan);
|
||||
}
|
||||
catch(Exception exception)
|
||||
{
|
||||
|
|
100
TINK.sln
|
@ -35,6 +35,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meinkonrad.Android", "Meink
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Meinkonrad.iOS", "Meinkonrad\TINK.iOS\Meinkonrad.iOS.csproj", "{CF1B848A-D1DF-40AB-BA6F-B1E1746A1161}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFramework", "TestFramework\TestFramework.csproj", "{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestSharee", "TestSharee\TestSharee.csproj", "{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
LastenradBayern\TINK\LastenradBayern.projitems*{0b1ad2f8-7ada-4c20-b0bd-58f32a224a71}*SharedItemsImports = 4
|
||||
|
@ -723,6 +727,102 @@ Global
|
|||
{CF1B848A-D1DF-40AB-BA6F-B1E1746A1161}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
{CF1B848A-D1DF-40AB-BA6F-B1E1746A1161}.Release|x64.ActiveCfg = Release|iPhoneSimulator
|
||||
{CF1B848A-D1DF-40AB-BA6F-B1E1746A1161}.Release|x86.ActiveCfg = Release|iPhoneSimulator
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|ARM.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|ARM.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|iPhone.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|x64.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|x64.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|x86.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.AppStore|x86.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9EA4ED8C-C4C3-48DC-8CBE-9281E0A7CA8D}.Release|x86.Build.0 = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|ARM.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|ARM.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|iPhone.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|x64.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|x64.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|x86.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.AppStore|x86.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9C80A989-4BBB-4F00-AB5D-45B1F99D5A08}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.hauffware.sharee" android:versionName="3.0.260" android:versionCode="260">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.hauffware.sharee" android:versionName="3.0.261" android:versionCode="261">
|
||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
|
||||
<!-- Google Maps related permissions -->
|
||||
<!-- Permission to receive remote notifications from Google Play Services -->
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using Foundation;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
using Xamarin.Forms;
|
||||
|
||||
|
|
|
@ -48,9 +48,9 @@
|
|||
<string>Is required to show map at current position and pass position to server when returning bike.</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>sharee.bike</string>
|
||||
<key>CFBundleVersion</key>.?
|
||||
<string>260</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>261</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.0.259</string>
|
||||
<string>3.0.261</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -93,6 +93,7 @@ namespace TINK
|
|||
JsonSettingsDictionary.GetConnectTimeout(settingsJSON),
|
||||
JsonSettingsDictionary.GetActiveGeolocationService(settingsJSON),
|
||||
JsonSettingsDictionary.GetCenterMapToCurrentLocation(settingsJSON),
|
||||
Xamarin.Forms.GoogleMaps.MapSpan.FromCenterAndRadius(new Xamarin.Forms.GoogleMaps.Position(47.995865, 7.815086), Xamarin.Forms.GoogleMaps.Distance.FromKilometers(2.9)),
|
||||
JsonSettingsDictionary.GetLogToExternalFolder(settingsJSON),
|
||||
JsonSettingsDictionary.GetIsSiteCachingOn(settingsJSON),
|
||||
JsonSettingsDictionary.GetActiveTheme(settingsJSON));
|
||||
|
|
|
@ -204,8 +204,7 @@ namespace TINK.View.Map
|
|||
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
|
||||
MapPageViewModel.MoveAndScale(
|
||||
(mapSpan) => MyMap.MoveToRegion(mapSpan),
|
||||
App.ModelRoot.Uris.ActiveUri,
|
||||
App.ModelRoot.GroupFilterMapPage);
|
||||
App.ModelRoot.MapSpan);
|
||||
}
|
||||
catch(Exception exception)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace TINK.Model.Connector.Filter
|
||||
{
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
/// Was "TINK" up to version 3.0.258.
|
||||
/// Specified first: "KN300029" (RG).
|
||||
/// </remarks>
|
||||
public const string FILTERTINKGENERAL = "300102";
|
||||
public const string FILTERTINKGENERAL = "300103";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,6 +60,9 @@ namespace TINK.Model
|
|||
/// <summary> Value indicating whether map is centerted to current position or not. </summary>
|
||||
bool CenterMapToCurrentLocation { get; set; }
|
||||
|
||||
/// <summary> Holds the map area to display. </summary>
|
||||
Xamarin.Forms.GoogleMaps.MapSpan MapSpan { get; set; }
|
||||
|
||||
bool LogToExternalFolder { get; set; }
|
||||
|
||||
bool IsSiteCachingOn { get; set; }
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace TINK.ViewModel.Settings
|
|||
|
||||
private IGroupFilter Filter { get; }
|
||||
|
||||
/// <summary> Performs filtering on response-group. </summary>
|
||||
/// <summary> Performs filtering on response -group. </summary>
|
||||
public IEnumerable<string> DoFilter(IEnumerable<string> filter = null) => Filter.DoFilter(filter);
|
||||
|
||||
public FilterState this[string key] { get => FilterDictionary[key]; set => FilterDictionary[key] = value; }
|
||||
|
|
|
@ -495,11 +495,15 @@ namespace TINK.Model.Settings
|
|||
// Process legacy entries.
|
||||
var updatedFilterCollection = legacyFilterCollection.Where(x => x.Key.ToUpper() != "TINK.SMS" && x.Key.ToUpper() != "TINK.COPRI").ToDictionary(x => x.Key, x => x.Value);
|
||||
if (legacyFilterCollection.Count() <= updatedFilterCollection.Count())
|
||||
{
|
||||
// No legacy entries "INK.SMS" or "TINK.COPRI" found.
|
||||
return legacyFilterCollection;
|
||||
}
|
||||
|
||||
var list = updatedFilterCollection.ToList();
|
||||
|
||||
updatedFilterCollection.Add(
|
||||
FilterHelper.FILTERTINKGENERAL,
|
||||
"TINK",
|
||||
legacyFilterCollection.Any(x => x.Key.ToUpper() == "TINK.COPRI") ? legacyFilterCollection.FirstOrDefault(x => x.Key.ToUpper() == "TINK.COPRI").Value : FilterState.Off);
|
||||
|
||||
return new GroupFilterSettings(updatedFilterCollection);
|
||||
|
|
|
@ -46,6 +46,7 @@ namespace TINK.Model.Settings
|
|||
TimeSpan? connectTimeout = null,
|
||||
string activeGeolocationService = null,
|
||||
bool? centerMapToCurrentLocation = null,
|
||||
Xamarin.Forms.GoogleMaps.MapSpan mapSpan = null,
|
||||
bool? logToExternalFolder = null,
|
||||
bool? isSiteCachingOn = null,
|
||||
string activeTheme = null)
|
||||
|
@ -61,6 +62,7 @@ namespace TINK.Model.Settings
|
|||
ConnectTimeout = connectTimeout ?? new TimeSpan(0, 0, TimeOutProvider.DEFAULT_BLUETOOTHCONNECT_TIMEOUTSECONDS); // Try one sec. to connect.
|
||||
ActiveGeolocationService = activeGeolocationService ?? DefaultLocationService.Name;
|
||||
CenterMapToCurrentLocation = centerMapToCurrentLocation ?? GetCenterMapToCurrentLocation(activeUri);
|
||||
MapSpan = mapSpan;
|
||||
LogToExternalFolder = logToExternalFolder ?? false;
|
||||
IsSiteCachingOn = isSiteCachingOn ?? true;
|
||||
ActiveTheme = activeTheme ?? typeof(Themes.ShareeBike).FullName;
|
||||
|
@ -93,8 +95,12 @@ namespace TINK.Model.Settings
|
|||
/// <summary> Gets the geolocation service to use.</summary>
|
||||
public string ActiveGeolocationService { get; }
|
||||
|
||||
/// <summary> True if map is centered to current positon, false if not to center map.</summary>
|
||||
public bool CenterMapToCurrentLocation { get; }
|
||||
|
||||
/// <summary> Holds the map area to display. </summary>
|
||||
public Xamarin.Forms.GoogleMaps.MapSpan MapSpan { get; }
|
||||
|
||||
public bool LogToExternalFolder { get; }
|
||||
|
||||
public bool IsSiteCachingOn { get; }
|
||||
|
|
|
@ -65,6 +65,9 @@ namespace TINK.Model
|
|||
/// <summary> Value indicating whether map is centerted to current position or not. </summary>
|
||||
public bool CenterMapToCurrentLocation { get; set; }
|
||||
|
||||
/// <summary> Holds the map area to display. </summary>
|
||||
public Xamarin.Forms.GoogleMaps.MapSpan MapSpan { get; set; }
|
||||
|
||||
/// <summary> Gets the minimum logging level. </summary>
|
||||
public LogEventLevel MinimumLogEventLevel { get; set; }
|
||||
|
||||
|
@ -208,6 +211,8 @@ namespace TINK.Model
|
|||
|
||||
CenterMapToCurrentLocation = settings.CenterMapToCurrentLocation;
|
||||
|
||||
MapSpan = settings.MapSpan;
|
||||
|
||||
SmartDevice = device
|
||||
?? throw new ArgumentException("Can not instantiate TinkApp- object. No device information provider available.");
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="TINK.Themes.Konrad">
|
||||
<!-- Pallete -->
|
||||
<!-- Red #ff0000 -->
|
||||
<Color x:Key="primary-back-title-color">Red</Color>
|
||||
<!-- Pallete-end -->
|
||||
<Style ApplyToDerivedTypes="true" TargetType="NavigationPage">
|
||||
|
|
|
@ -158,9 +158,7 @@ namespace TINK.ViewModel.Account
|
|||
return AppResources.MarkingLoggedInStateInfoNotLoggedIn;
|
||||
}
|
||||
|
||||
return TinkApp.ActiveUser.Group.Intersect(new List<string> { FilterHelper.FILTERTINKGENERAL, FilterHelper.FILTERKONRAD }).Any()
|
||||
? string.Format(AppResources.MarkingLoggedInStateInfoLoggedInGroup, TinkApp.ActiveUser.Mail, TinkApp.ActiveUser.GetUserGroupDisplayName())
|
||||
: string.Format(AppResources.MarkingLoggedInStateInfoLoggedIn, TinkApp.ActiveUser.Mail);
|
||||
return string.Format(AppResources.MarkingLoggedInStateInfoLoggedIn, TinkApp.ActiveUser.Mail);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ using Xamarin.Essentials;
|
|||
using System.Threading;
|
||||
using TINK.MultilingualResources;
|
||||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Model.Services.CopriApi.ServerUris;
|
||||
using TINK.ViewModel.Info;
|
||||
using TINK.Repository;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
|
@ -420,19 +419,26 @@ namespace TINK.ViewModel.Map
|
|||
|
||||
// Move and scale before getting stations and bikes which takes some time.
|
||||
ActionText = AppResources.ActivityTextCenterMap;
|
||||
Location currentLocation = null;
|
||||
try
|
||||
if (TinkApp.CenterMapToCurrentLocation)
|
||||
{
|
||||
currentLocation = TinkApp.CenterMapToCurrentLocation
|
||||
? await GeolocationService.GetAsync()
|
||||
: null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
|
||||
Location currentLocation = null;
|
||||
try
|
||||
{
|
||||
currentLocation = await GeolocationService.GetAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
|
||||
}
|
||||
|
||||
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
|
||||
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
|
||||
TinkApp.MapSpan.Radius);
|
||||
|
||||
TinkApp.Save();
|
||||
}
|
||||
|
||||
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.Uris.ActiveUri, ActiveFilterMap, currentLocation);
|
||||
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.MapSpan);
|
||||
|
||||
m_oViewUpdateManager = CreateUpdateTask();
|
||||
|
||||
|
@ -471,44 +477,14 @@ namespace TINK.ViewModel.Map
|
|||
/// <summary> Moves map and scales visible region depending on active filter. </summary>
|
||||
public static void MoveAndScale(
|
||||
Action<MapSpan> moveToRegionDelegate,
|
||||
Uri activeUri,
|
||||
IGroupFilterMapPage groupFilterMapPage,
|
||||
Location currentLocation = null)
|
||||
MapSpan currentMapSpan = null)
|
||||
{
|
||||
if (currentLocation != null)
|
||||
if (currentMapSpan != null)
|
||||
{
|
||||
// Move to current location.
|
||||
moveToRegionDelegate(MapSpan.FromCenterAndRadius(
|
||||
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
|
||||
Distance.FromKilometers(1.0)));
|
||||
moveToRegionDelegate(currentMapSpan);
|
||||
return;
|
||||
}
|
||||
|
||||
if (activeUri.AbsoluteUri == CopriServerUriList.SHAREE_LIVE ||
|
||||
activeUri.AbsoluteUri == CopriServerUriList.SHAREE_DEVEL)
|
||||
{
|
||||
// Center map to Freiburg
|
||||
moveToRegionDelegate(MapSpan.FromCenterAndRadius(
|
||||
new Xamarin.Forms.GoogleMaps.Position(47.995865, 7.815086),
|
||||
Distance.FromKilometers(2.9)));
|
||||
return;
|
||||
}
|
||||
|
||||
// Depending on whether TINK or Conrad is active set center of map and scale.
|
||||
if (groupFilterMapPage.GetGroup().Contains(FilterHelper.FILTERKONRAD))
|
||||
{
|
||||
// Konrad is activated,
|
||||
moveToRegionDelegate(MapSpan.FromCenterAndRadius(
|
||||
new Xamarin.Forms.GoogleMaps.Position(47.680, 9.180),
|
||||
Distance.FromKilometers(2.9)));
|
||||
}
|
||||
else
|
||||
{
|
||||
// TINK
|
||||
moveToRegionDelegate(MapSpan.FromCenterAndRadius(
|
||||
new Xamarin.Forms.GoogleMaps.Position(47.667, 9.172),
|
||||
Distance.FromKilometers(0.9)));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Creates a update task object. </summary>
|
||||
|
@ -894,21 +870,27 @@ namespace TINK.ViewModel.Map
|
|||
}
|
||||
|
||||
// Move and scale before getting stations and bikes which takes some time.
|
||||
Location currentLocation = null;
|
||||
try
|
||||
if (TinkApp.CenterMapToCurrentLocation)
|
||||
{
|
||||
currentLocation = TinkApp.CenterMapToCurrentLocation
|
||||
? await GeolocationService.GetAsync()
|
||||
: null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
|
||||
Location currentLocation = null;
|
||||
try
|
||||
{
|
||||
currentLocation = await GeolocationService.GetAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
|
||||
}
|
||||
|
||||
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
|
||||
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
|
||||
TinkApp.MapSpan.Radius);
|
||||
|
||||
TinkApp.Save();
|
||||
}
|
||||
|
||||
// Update stations
|
||||
// Depending on whether TINK or Conrad is active set center of map and scale.
|
||||
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.Uris.ActiveUri, ActiveFilterMap, currentLocation);
|
||||
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.MapSpan);
|
||||
|
||||
IsConnected = TinkApp.GetIsConnected();
|
||||
var resultStationsAndBikes = await TinkApp.GetConnector(IsConnected).Query.GetBikesAndStationsAsync();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using TINK.Model.Device;
|
||||
|
||||
namespace TestTINKLib.Mocks.Device
|
||||
namespace TestFramework.Model.Device
|
||||
{
|
||||
public class DeviceMock : ISmartDevice
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using TINK.Model.Device;
|
||||
|
||||
namespace TestTINKLib.Mocks.Device
|
||||
namespace TestFramework.Model.Device
|
||||
{
|
||||
public class SpecialFolderMock : ISpecialFolder
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
using System.Threading.Tasks;
|
||||
using TINK.Model.User.Account;
|
||||
|
||||
namespace TestTINKLib.Model.User.Account
|
||||
namespace TestFramework.Model.User.Account
|
||||
{
|
||||
public class StoreMock : IStore
|
||||
{
|
306
TestFramework/Repository/CopriCallMemoryBase.cs
Normal file
|
@ -0,0 +1,306 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Repository;
|
||||
using TINK.Repository.Request;
|
||||
using TINK.Repository.Response;
|
||||
|
||||
namespace TestFramework.Repository
|
||||
{
|
||||
/// <summary> Provides functionality for keeping a set of COPRI responses. </summary>
|
||||
public abstract class CopriCallMemoryBase
|
||||
{
|
||||
private string BikesAvailableResponse { get; }
|
||||
|
||||
private string BikesOccupiedResponse { get; }
|
||||
|
||||
private string AuthResponse { get; }
|
||||
|
||||
private string AuthOutResponse { get; }
|
||||
|
||||
private string Stations { get; }
|
||||
|
||||
private string BookingRequestResponse { get; }
|
||||
|
||||
private string CancelBookingRequestResponse { get; }
|
||||
|
||||
private IRequestBuilder requestBuilder;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs copri server mock from build in resources.
|
||||
/// </summary>
|
||||
/// <param name="bikesAvailableResponseResource"></param>
|
||||
/// <param name="bikesOccupiedResponseResoure"></param>
|
||||
/// <param name="authResponseResource"></param>
|
||||
/// <param name="authOutResponseResource"></param>
|
||||
/// <param name="stationsResponseResource"></param>
|
||||
/// <param name="bookingRequestResponseResource"></param>
|
||||
/// <param name="cancelBookingRequestResponseResource"></param>
|
||||
/// <param name="sessionCookie"></param>
|
||||
public CopriCallMemoryBase(
|
||||
string bikesAvailableResponseResource = null,
|
||||
string bikesOccupiedResponseResoure = null,
|
||||
string authResponseResource = null,
|
||||
string authOutResponseResource = null,
|
||||
string stationsResponseResource = null,
|
||||
string bookingRequestResponseResource = null,
|
||||
string cancelBookingRequestResponseResource = null,
|
||||
string sessionCookie = null)
|
||||
{
|
||||
string ReadResource(string resourceName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(resourceName))
|
||||
return string.Empty;
|
||||
|
||||
using (var streamReader = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName)))
|
||||
{
|
||||
return streamReader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
SessionCookie = sessionCookie;
|
||||
|
||||
BikesAvailableResponse = ReadResource(bikesAvailableResponseResource);
|
||||
BikesOccupiedResponse = ReadResource(bikesOccupiedResponseResoure);
|
||||
AuthResponse = ReadResource(authResponseResource);
|
||||
AuthOutResponse = ReadResource(authOutResponseResource);
|
||||
Stations = ReadResource(stationsResponseResource);
|
||||
BookingRequestResponse = ReadResource(bookingRequestResponseResource);
|
||||
CancelBookingRequestResponse = ReadResource(cancelBookingRequestResponseResource);
|
||||
|
||||
requestBuilder = string.IsNullOrEmpty(sessionCookie)
|
||||
? new RequestBuilder(MerchantId) as IRequestBuilder
|
||||
: new RequestBuilderLoggedIn(MerchantId, sessionCookie);
|
||||
}
|
||||
|
||||
/// <summary> Holds the session id of the logged in user, null otherwise. </summary>
|
||||
public string SessionCookie { get; private set; }
|
||||
|
||||
/// <summary> Logs user in. </summary>
|
||||
/// <param name="p_oUser">User to log in.</param>
|
||||
/// <param name="deviceId">Id specifying user and hardware.</param>
|
||||
/// <param name="mailAddress">Mailaddress of user to log in.</param>
|
||||
/// <param name="password">Password to log in.</param>
|
||||
/// <remarks>Response which holds auth cookie <see cref="ResponseBase.authcookie"/></remarks>
|
||||
public async Task<AuthorizationResponse> DoAuthorizationAsync(
|
||||
string mailAddress,
|
||||
string password,
|
||||
string deviceId)
|
||||
=> await Task.Run(() => DoAuthorize(AuthResponse, mailAddress, password, deviceId));
|
||||
|
||||
/// <summary> Logs user out. </summary>
|
||||
/// <param name="sessionCookie">User to log in.</param>
|
||||
/// <remarks>Response which holds auth cookie <see cref="ResponseBase.authcookie"/></remarks>
|
||||
public async Task<AuthorizationoutResponse> DoAuthoutAsync()
|
||||
=> await Task.Run(() => DoAuthout(AuthOutResponse, SessionCookie));
|
||||
|
||||
/// <summary>
|
||||
/// Gets list of bikes from memory.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<BikesAvailableResponse> GetBikesAvailableAsync()
|
||||
=> await Task.Run(() => GetBikesAvailable(BikesAvailableResponse, null, SessionCookie));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of bikes reserved/ booked by acctive user from Copri.
|
||||
/// </summary>
|
||||
/// <param name="p_strSessionCookie">Cookie to authenticate user.</param>
|
||||
/// <returns>Response holding list of bikes.</returns>
|
||||
public async Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
requestBuilder.GetBikesOccupied(); // Non mock implementation if ICopriServer call this member as well. To ensure comparable behaviour this member is called here as well.
|
||||
}
|
||||
catch (NotSupportedException)
|
||||
{
|
||||
// No user logged in.
|
||||
await Task.CompletedTask;
|
||||
return ResponseHelper.GetBikesOccupiedNone();
|
||||
}
|
||||
return await Task.Run(() => GetBikesOccupied(BikesOccupiedResponse, SessionCookie));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get list of stations from file.
|
||||
/// </summary>
|
||||
/// <param name="p_strCookie">Auto cookie of user if user is logged in.</param>
|
||||
/// <returns>List of files.</returns>
|
||||
public async Task<StationsAvailableResponse> GetStationsAsync()
|
||||
=> await Task.Run(() => GetStationsAll(Stations, null, SessionCookie));
|
||||
|
||||
/// <summary>
|
||||
/// Gets booking request response.
|
||||
/// </summary>
|
||||
/// <param name="bikeId">Id of the bike to book.</param>
|
||||
/// <returns>Booking response.</returns>
|
||||
public async Task<ReservationBookingResponse> DoReserveAsync(string bikeId, Uri operatorUri)
|
||||
=> await Task.Run(() => DoReserve(BookingRequestResponse, bikeId, SessionCookie));
|
||||
|
||||
/// <summary>
|
||||
/// Gets canel booking request response.
|
||||
/// </summary>
|
||||
/// <param name="bikeId">Id of the bike to book.</param>
|
||||
/// <param name="p_strCookie">Cookie of the logged in user.</param>
|
||||
/// <returns>Response on cancel booking request.</returns>
|
||||
public async Task<ReservationCancelReturnResponse> DoCancelReservationAsync(string bikeId, Uri operatorUri)
|
||||
=> await Task.Run(() => DoCancelReservation(CancelBookingRequestResponse, bikeId, SessionCookie));
|
||||
|
||||
|
||||
/// <summary> Gets the merchant id.</summary>
|
||||
public string MerchantId => TinkApp.MerchantId;
|
||||
|
||||
/// <summary> Returns false because cached values are returned. </summary>
|
||||
public bool IsConnected => false;
|
||||
|
||||
/// <summary> Logs user in. </summary>
|
||||
/// <param name="p_oUser">User to log in.</param>
|
||||
/// <param name="p_strDeviceId">Id specifying user and hardware.</param>
|
||||
/// <param name="p_strMailAddress">Mailaddress of user to log in.</param>
|
||||
/// <param name="p_strPassword">Password to log in.</param>
|
||||
/// <remarks>Response which holds auth cookie <see cref="ResponseBase.authcookie"/></remarks>
|
||||
public static AuthorizationResponse DoAuthorize(
|
||||
string DoAuthResponse,
|
||||
string p_strMailAddress,
|
||||
string p_strPassword,
|
||||
string p_strDeviceId)
|
||||
{
|
||||
return p_strMailAddress == "javaminister@gmail.com"
|
||||
&& p_strPassword == "*********" &&
|
||||
p_strDeviceId == "HwId1000000000000"
|
||||
? JsonConvertRethrow.DeserializeObject<ResponseContainer<AuthorizationResponse>>(DoAuthResponse).shareejson
|
||||
: JsonConvertRethrow.DeserializeObject<ResponseContainer<AuthorizationResponse>>(DO_AUTH_Unknown_User_FILE).shareejson;
|
||||
|
||||
}
|
||||
|
||||
/// <summary> Logs user in. </summary>
|
||||
/// <remarks>Response which holds auth cookie <see cref="ResponseBase.authcookie"/></remarks>
|
||||
public static AuthorizationoutResponse DoAuthout(
|
||||
string authOutResponse,
|
||||
string sessionCookie)
|
||||
{
|
||||
// Response contains auth cookie of user "JavaministerHardwareNr1"
|
||||
// For this reason do not return answer if mail and pwd do not match.
|
||||
|
||||
return !string.IsNullOrEmpty(sessionCookie)
|
||||
? JsonConvertRethrow.DeserializeObject<ResponseContainer<AuthorizationoutResponse>>(authOutResponse).shareejson
|
||||
: throw new NotSupportedException();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets list of bikes from memory.
|
||||
/// </summary>
|
||||
/// <param name="p_strMerchantId">Id of the merchant.</param>
|
||||
/// <param name="p_strSessionCookie">Auto cookie of user if user is logged in.</param>
|
||||
/// <param name="p_eSampleSet">Set of samples.</param>
|
||||
/// <param name="p_lStageIndex">Index of the stage.</param>
|
||||
/// <returns></returns>
|
||||
public static BikesAvailableResponse GetBikesAvailable(
|
||||
string BikesAvailableResponse,
|
||||
string p_strMerchantId,
|
||||
string p_strSessionCookie = null) =>
|
||||
CopriCallsStatic.DeserializeResponse<BikesAvailableResponse>(BikesAvailableResponse);
|
||||
|
||||
/// <summary>
|
||||
/// Gets stations response.
|
||||
/// </summary>
|
||||
/// <param name="merchantId">Id of the merchant.</param>
|
||||
/// <param name="cookie">Auto cookie of user if user is logged in.</param>
|
||||
/// <param name="p_eSampleSet"></param>
|
||||
/// <param name="p_lStageIndex"></param>
|
||||
/// <returns></returns>
|
||||
public static StationsAvailableResponse GetStationsAll(
|
||||
string stations,
|
||||
string merchantId,
|
||||
string cookie = null)
|
||||
=> JsonConvertRethrow.DeserializeObject<ResponseContainer<StationsAvailableResponse>>(stations).shareejson;
|
||||
|
||||
/// <summary>
|
||||
/// Gets booking request response.
|
||||
/// </summary>
|
||||
/// <param name="bikeId">Id of the bike.</param>
|
||||
/// <param name="sessionCookie">Identifies the logged in user.</param>
|
||||
/// <param name="sampleSet">Sample set to use.</param>
|
||||
/// <param name="stageIndex">Index of the stage.</param>
|
||||
/// <returns></returns>
|
||||
public static ReservationBookingResponse DoReserve(
|
||||
string bookingRequestResponse,
|
||||
string bikeId,
|
||||
string sessionCookie)
|
||||
=> JsonConvertRethrow.DeserializeObject<ResponseContainer<ReservationBookingResponse>>(bookingRequestResponse).shareejson;
|
||||
|
||||
/// <summary>
|
||||
/// Gets canel booking request response.
|
||||
/// </summary>
|
||||
/// <param name="bikeId">Id of the bike to book.</param>
|
||||
/// <param name="cookie">Cookie of the logged in user.</param>
|
||||
/// <returns>Response on cancel booking request.</returns>
|
||||
public static ReservationCancelReturnResponse DoCancelReservation(
|
||||
string cancelBookingRequestResponse,
|
||||
string bikeId,
|
||||
string cookie)
|
||||
=> JsonConvertRethrow.DeserializeObject<ResponseContainer<ReservationCancelReturnResponse>>(cancelBookingRequestResponse).shareejson;
|
||||
|
||||
public Task<ReservationBookingResponse> CalculateAuthKeysAsync(string bikeId, Uri operatorUri)
|
||||
=> null;
|
||||
|
||||
public Task<ReservationBookingResponse> UpdateLockingStateAsync(
|
||||
string bikeId,
|
||||
LocationDto geolocation,
|
||||
lock_state state,
|
||||
double batteryLevel,
|
||||
Uri operatorUri)
|
||||
=> null;
|
||||
|
||||
public Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
||||
=> null;
|
||||
|
||||
public Task<ReservationCancelReturnResponse> DoReturn(
|
||||
string bikeId,
|
||||
LocationDto geolocation,
|
||||
ISmartDevice smartDevice,
|
||||
Uri operatorUri)
|
||||
=> null;
|
||||
|
||||
public Task<SubmitFeedbackResponse> DoSubmitFeedback(string bikeId, string message, bool isBikeBroken, Uri operatorUri)
|
||||
=> null;
|
||||
|
||||
/// <summary> Submits mini survey to copri server. </summary>
|
||||
/// <param name="answers">Collection of answers.</param>
|
||||
public Task<ResponseBase> DoSubmitMiniSurvey(IDictionary<string, string> answers)
|
||||
=> null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of bikes reserved/ booked by acctive user from Copri.
|
||||
/// </summary>
|
||||
/// <param name="sessionCookie">Cookie to authenticate user.</param>
|
||||
/// <param name="SampleSet">Sample set to use.</param>
|
||||
/// <param name="p_lStageIndex">Index of the stage.</param>
|
||||
/// <returns>Response holding list of bikes.</returns>
|
||||
public static BikesReservedOccupiedResponse GetBikesOccupied(
|
||||
string bikesOccupied,
|
||||
string sessionCookie = null)
|
||||
{
|
||||
var response = CopriCallsStatic.DeserializeResponse<BikesReservedOccupiedResponse>(bikesOccupied);
|
||||
return sessionCookie != null && (response?.authcookie?.Contains(sessionCookie) ?? false)
|
||||
? response
|
||||
: ResponseHelper.GetBikesOccupiedNone(sessionCookie);
|
||||
|
||||
}
|
||||
|
||||
public const string DO_AUTH_Unknown_User_FILE = @"
|
||||
{
|
||||
""shareejson"" : {
|
||||
""response"" : ""authorization"",
|
||||
""authcookie"" : 0,
|
||||
""response_state"" : ""Failure: cannot generate authcookie"",
|
||||
""apiserver"" : ""https://tinkwwp.copri-bike.de""
|
||||
}
|
||||
}";
|
||||
}
|
||||
}
|
21
TestFramework/Repository/CopriCallsMemory001.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using TINK.Repository;
|
||||
|
||||
namespace TestFramework.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds some COPRI responses for testing purposes.
|
||||
/// </summary>
|
||||
/// <remarks> Holds some demo Meinkonrad and LastenradBayern bikes
|
||||
/// </remarks>
|
||||
public class CopriCallsMemory001 : CopriCallMemoryBase, ICopriServer
|
||||
{
|
||||
public CopriCallsMemory001(string sessionCookie = null) : base(
|
||||
bikesAvailableResponseResource: "TestFramework.Repository.CopriCallsMemory001.BikesAvailableResponse.json",
|
||||
bikesOccupiedResponseResoure: "TestFramework.Repository.CopriCallsMemory001.BikesOccupiedResponse.json",
|
||||
authResponseResource: "TestFramework.Repository.CopriCallsMemory001.AuthorizationResponse.json",
|
||||
authOutResponseResource: "TestFramework.Repository.CopriCallsMemory001.AuthoutResponse.json",
|
||||
stationsResponseResource: "TestFramework.Repository.CopriCallsMemory001.StationsAvailable.json",
|
||||
sessionCookie: sessionCookie)
|
||||
{ }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"shareejson": {
|
||||
"clearing_cache": "0",
|
||||
"privacy_html": "site/privacy.html",
|
||||
"user_id": "javaminister@gmail.com",
|
||||
"impress_html": "site/impress.html",
|
||||
"tariff_info_html": "site/tariff_info_1.html",
|
||||
"lang": "DE",
|
||||
"last_used_operator": {
|
||||
"operator_name": "sharee.bike | TeilRad GmbH",
|
||||
"operator_hours": "Bürozeiten: Montag, Mittwoch, Freitag 9-12 Uhr",
|
||||
"operator_phone": "+49 761 45370097",
|
||||
"operator_email": "hotline@sharee.bike",
|
||||
"operator_color": "#009699"
|
||||
},
|
||||
"response": "authorization",
|
||||
"agb_checked": "0",
|
||||
"agb_html": "site/agb.html",
|
||||
"response_text": "Herzlich willkommen im Fahrradmietsystem",
|
||||
"bike_info_html": "site/bike_info.html",
|
||||
"debuglevel": "1",
|
||||
"uri_primary": "https://shareeapp-primary.copri.eu",
|
||||
"response_state": "OK, nothing todo",
|
||||
"new_authcoo": "1",
|
||||
"user_tour": [],
|
||||
"authcookie": "6103_112e96b36ba33de245943c5ffaf369cd_oiF2kahH",
|
||||
"copri_version": "4.1.8.21",
|
||||
"apiserver": "https://shareeapp-fr01.copri.eu",
|
||||
"user_group": []
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"shareejson": {
|
||||
"copri_version": "4.1.8.21",
|
||||
"authcookie": "1",
|
||||
"user_tour": [],
|
||||
"user_group": null,
|
||||
"apiserver": "https://shareeapp-fr01.copri.eu",
|
||||
"debuglevel": "1",
|
||||
"uri_primary": "https://shareeapp-primary.copri.eu",
|
||||
"bike_info_html": "site/bike_info.html",
|
||||
"response_state": "OK, logout",
|
||||
"new_authcoo": "0",
|
||||
"lang": "DE",
|
||||
"last_used_operator": {
|
||||
"operator_hours": "Bürozeiten: Montag, Mittwoch, Freitag 9-12 Uhr",
|
||||
"operator_name": "sharee.bike | TeilRad GmbH",
|
||||
"operator_email": "hotline@sharee.bike",
|
||||
"operator_phone": "+49 761 45370097",
|
||||
"operator_color": "#009699"
|
||||
},
|
||||
"tariff_info_html": "site/tariff_info_1.html",
|
||||
"impress_html": "site/impress.html",
|
||||
"response_text": "Auf Wiedersehen.",
|
||||
"agb_html": "site/agb.html",
|
||||
"response": "authout",
|
||||
"agb_checked": "0",
|
||||
"privacy_html": "site/privacy.html",
|
||||
"clearing_cache": "0",
|
||||
"user_id": "javaminister@gmail.com"
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,270 @@
|
|||
{
|
||||
"shareejson": {
|
||||
"agb_checked": "1",
|
||||
"response": "bikes_available",
|
||||
"agb_html": "site/agb.html",
|
||||
"impress_html": "site/impress.html",
|
||||
"tariff_info_html": "site/tariff_info_1.html",
|
||||
"lang": "DE",
|
||||
"last_used_operator": {
|
||||
"operator_color": "#008dd2",
|
||||
"operator_email": "hotline@lastenraddemo.bayern",
|
||||
"operator_phone": "+49 089 / 111111111",
|
||||
"operator_name": "Lastenrad Bayern",
|
||||
"operator_hours": "Bürozeiten: Montag, Mittwoch, Freitag 9-12 Uhr",
|
||||
"operator_logo": ""
|
||||
},
|
||||
"user_id": "ohauff@posteo.de",
|
||||
"clearing_cache": "0",
|
||||
"privacy_html": "site/privacy.html",
|
||||
"bikes": {
|
||||
// Entry manually created (copy-paste). Might contain dupe entries (2021-11-12).
|
||||
"FR9999": {
|
||||
"system": "Ilockit",
|
||||
"gps": {
|
||||
"longitude": "7.8255321",
|
||||
"latitude": "47.9767121"
|
||||
},
|
||||
"lock_state": "locked",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-cc141a6f68bb",
|
||||
"state": "available",
|
||||
"tariff_description": {
|
||||
"free_hours": "0.50",
|
||||
"name": "Tester Basic",
|
||||
"eur_per_hour": "3.00",
|
||||
"number": "5494",
|
||||
"1543": {
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."
|
||||
},
|
||||
"max_eur_per_day": "10.00"
|
||||
},
|
||||
"bike_group": [
|
||||
"FR300103"
|
||||
],
|
||||
"station": "FR103",
|
||||
"description": "Quest Carbon",
|
||||
"Ilockit_ID": "ISHAREIT-9999999",
|
||||
"authed": "1",
|
||||
"bike": "FR9999",
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu"
|
||||
},
|
||||
// Entry manually created (copy-paste). Might contain dupe entries (2021-11-12).
|
||||
"FR9998": {
|
||||
"system": "Ilockit",
|
||||
"gps": {
|
||||
"longitude": "7.8255321",
|
||||
"latitude": "47.9767121"
|
||||
},
|
||||
"lock_state": "locked",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-cc141a6f68bb",
|
||||
"state": "available",
|
||||
"tariff_description": {
|
||||
"free_hours": "0.50",
|
||||
"name": "Bacchetta Giro",
|
||||
"eur_per_hour": "3.00",
|
||||
"number": "5494",
|
||||
"1543": {
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."
|
||||
},
|
||||
"max_eur_per_day": "10.00"
|
||||
},
|
||||
"bike_group": [
|
||||
"FR300103"
|
||||
],
|
||||
"station": "FR103",
|
||||
"description": "Quest Carbon",
|
||||
"Ilockit_ID": "ISHAREIT-9999999",
|
||||
"authed": "1",
|
||||
"bike": "FR9998",
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu"
|
||||
},
|
||||
"FR1543": {
|
||||
"system": "Ilockit",
|
||||
"gps": {
|
||||
"longitude": "7.8255321",
|
||||
"latitude": "47.9767121"
|
||||
},
|
||||
"lock_state": "locked",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-cc141a6f68bb",
|
||||
"state": "available",
|
||||
"tariff_description": {
|
||||
"free_hours": "0.50",
|
||||
"name": "Tester Basic",
|
||||
"eur_per_hour": "3.00",
|
||||
"number": "5494",
|
||||
"1543": {
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."
|
||||
},
|
||||
"max_eur_per_day": "10.00"
|
||||
},
|
||||
"bike_group": [
|
||||
"FR300103"
|
||||
],
|
||||
"station": "FR101",
|
||||
"description": "Contributor-bike Dominik",
|
||||
"Ilockit_ID": "ISHAREIT-2200543",
|
||||
"authed": "1",
|
||||
"bike": "FR1543",
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu"
|
||||
},
|
||||
"FR1003": {
|
||||
"bike": "FR1003",
|
||||
"authed": "1",
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu",
|
||||
"bike_group": [
|
||||
"FR300101"
|
||||
],
|
||||
"Ilockit_ID": "ISHAREIT-2200545",
|
||||
"station": "FR101",
|
||||
"description": "Stadtrad",
|
||||
"tariff_description": {
|
||||
"max_eur_per_day": "10.00",
|
||||
"number": "5491",
|
||||
"eur_per_hour": "2.00",
|
||||
"1003": {
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."
|
||||
},
|
||||
"free_hours": "0.50",
|
||||
"name": "Vauban Basic"
|
||||
},
|
||||
"state": "available",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-e38bf9d32234",
|
||||
"system": "Ilockit",
|
||||
"gps": {
|
||||
"longitude": "7.8255772",
|
||||
"latitude": "47.9765188"
|
||||
},
|
||||
"lock_state": "locked"
|
||||
},
|
||||
"FR1540": {
|
||||
"bike_group": [
|
||||
"FR300103"
|
||||
],
|
||||
"Ilockit_ID": "ISHAREIT-2200540",
|
||||
"description": "Contributor-bike Dieter",
|
||||
"station": "FR101",
|
||||
"bike": "FR1540",
|
||||
"authed": "1",
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-fc3c002a2add",
|
||||
"system": "Ilockit",
|
||||
"gps": {
|
||||
"longitude": "7.8256267",
|
||||
"latitude": "47.976803"
|
||||
},
|
||||
"lock_state": "locked",
|
||||
"tariff_description": {
|
||||
"1540": {
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."
|
||||
},
|
||||
"free_hours": "0.50",
|
||||
"name": "Tester Basic",
|
||||
"max_eur_per_day": "10.00",
|
||||
"eur_per_hour": "3.00",
|
||||
"number": "5494"
|
||||
},
|
||||
"state": "available"
|
||||
},
|
||||
"FR1002": {
|
||||
"bike_group": [
|
||||
"FR300101"
|
||||
],
|
||||
"description": "Lasten-Dreirad",
|
||||
"station": "FR101",
|
||||
"Ilockit_ID": "ISHAREIT-2200539",
|
||||
"authed": "1",
|
||||
"bike": "FR1002",
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu",
|
||||
"gps": {
|
||||
"latitude": "47.976552",
|
||||
"longitude": "7.8255068"
|
||||
},
|
||||
"system": "Ilockit",
|
||||
"lock_state": "locked",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-f0b4a692e169",
|
||||
"state": "available",
|
||||
"tariff_description": {
|
||||
"max_eur_per_day": "10.00",
|
||||
"1002": {
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."
|
||||
},
|
||||
"eur_per_hour": "2.00",
|
||||
"number": "5491",
|
||||
"free_hours": "0.50",
|
||||
"name": "Vauban Basic"
|
||||
}
|
||||
},
|
||||
"FR1538": {
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu",
|
||||
"authed": "1",
|
||||
"bike": "FR1538",
|
||||
"station": "FR105",
|
||||
"description": "Contributor-bike Rainer",
|
||||
"Ilockit_ID": "ISHAREIT-2200538",
|
||||
"bike_group": [
|
||||
"FR300103"
|
||||
],
|
||||
"state": "available",
|
||||
"tariff_description": {
|
||||
"max_eur_per_day": "10.00",
|
||||
"eur_per_hour": "3.00",
|
||||
"number": "5494",
|
||||
"1538": {
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."
|
||||
},
|
||||
"free_hours": "0.50",
|
||||
"name": "Tester Basic"
|
||||
},
|
||||
"gps": {
|
||||
"latitude": "47.9275957",
|
||||
"longitude": "7.973976"
|
||||
},
|
||||
"lock_state": "locked",
|
||||
"system": "Ilockit",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-db0319a2555b"
|
||||
},
|
||||
"FR1001": {
|
||||
"bike_group": [
|
||||
"FR300101"
|
||||
],
|
||||
"station": "FR101",
|
||||
"description": "Lastenrad",
|
||||
"Ilockit_ID": "ISHAREIT-2200536",
|
||||
"authed": "1",
|
||||
"bike": "FR1001",
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu",
|
||||
"lock_state": "locked",
|
||||
"gps": {
|
||||
"latitude": "47.9765091",
|
||||
"longitude": "7.8255631"
|
||||
},
|
||||
"system": "Ilockit",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-caa87760e53e",
|
||||
"state": "available",
|
||||
"tariff_description": {
|
||||
"free_hours": "0.50",
|
||||
"name": "Vauban Basic",
|
||||
"eur_per_hour": "2.00",
|
||||
"number": "5491",
|
||||
"max_eur_per_day": "10.00",
|
||||
"1001": {
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"user_group": [
|
||||
"FR300103",
|
||||
"FR300101"
|
||||
],
|
||||
"apiserver": "https://shareeapp-fr01.copri.eu",
|
||||
"user_tour": [],
|
||||
"authcookie": "6103_112e96b36ba33de245943c5ffaf369cd_oiF2kahH",
|
||||
"copri_version": "4.1.8.21",
|
||||
"response_state": "OK, nothing todo",
|
||||
"new_authcoo": "0",
|
||||
"bike_info_html": "site/bike_info.html",
|
||||
"debuglevel": "1",
|
||||
"uri_primary": "https://shareeapp-primary.copri.eu"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
{
|
||||
"shareejson": {
|
||||
"authcookie": "6103_112e96b36ba33de245943c5ffaf369cd_oiF2kahH",
|
||||
"copri_version": "4.1.8.21",
|
||||
"user_tour": [],
|
||||
"user_group": [
|
||||
"FR300103",
|
||||
"FR300101"
|
||||
],
|
||||
"bikes_occupied": {
|
||||
"157056": {
|
||||
"K_seed": "[-20, -104, -112, -49, 3, -74, -43, -115, -53, 34, -48, -29, -64, -90, -26, -74]",
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu",
|
||||
"bike": "FR1544",
|
||||
"unit_price": "3.00",
|
||||
"description": "Contributor-Paul",
|
||||
"station": "FR103",
|
||||
"request_time": "2021-11-06 18:57:20.034438+01",
|
||||
"Ilockit_ID": "ISHAREIT-2200544",
|
||||
"total_price": "25.50",
|
||||
"bike_group": [
|
||||
"FR300103"
|
||||
],
|
||||
"K_u": "[43, -16, 72, -5, 23, -117, 43, 57, 124, -106, -115, 97, -93, -30, -34, -7, -21, 119, 109, 92, 0, 0, 0, 0]",
|
||||
"computed_hours": "8.50",
|
||||
"end_time": "2021-11-08 21:14:35",
|
||||
"state": "occupied",
|
||||
"tariff_description": {
|
||||
"eur_per_hour": "3.00",
|
||||
"number": "5494",
|
||||
"max_eur_per_day": "10.00",
|
||||
"name": "Tester Basic",
|
||||
"free_hours": "0.50",
|
||||
"track_info": "Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!",
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."
|
||||
},
|
||||
"lock_state": "locked",
|
||||
"system": "Ilockit",
|
||||
"gps": {
|
||||
"latitude": "47.9994661873206",
|
||||
"longitude": "7.7904340904206"
|
||||
},
|
||||
"real_hours": "50.2833333333333",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-dc969f648732",
|
||||
"start_time": "2021-11-06 18:57:25.445447+01"
|
||||
},
|
||||
"157072": {
|
||||
"bike": "FR1004",
|
||||
"K_seed": "[-31, -81, -41, 95, 112, -113, -78, -22, 84, -112, -73, 31, -125, -49, 125, 10]",
|
||||
"uri_operator": "https://shareeapp-fr01.copri.eu",
|
||||
"bike_group": [
|
||||
"FR300103"
|
||||
],
|
||||
"total_price": "0.00",
|
||||
"description": "Contributor-Recumbent",
|
||||
"station": "FR103",
|
||||
"request_time": "2021-11-08 21:10:24.829395+01",
|
||||
"Ilockit_ID": "ISHAREIT-2302373",
|
||||
"unit_price": "3.00",
|
||||
"end_time": "2021-11-08 21:10:00+01",
|
||||
"state": "requested",
|
||||
"tariff_description": {
|
||||
"operator_agb": "Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB).",
|
||||
"free_hours": "0.50",
|
||||
"name": "Tester Basic",
|
||||
"max_eur_per_day": "10.00",
|
||||
"eur_per_hour": "3.00",
|
||||
"number": "5494"
|
||||
},
|
||||
"computed_hours": "0",
|
||||
"K_u": "[126, -125, 125, 83, 104, -121, -80, 40, 77, -35, 81, 27, 89, -124, -37, 57, 118, -113, 71, -37, 0, 0, 0, 0]",
|
||||
"start_time": "2021-11-08 21:10:24.829395+01",
|
||||
"gps": {
|
||||
"latitude": "47.9980777",
|
||||
"longitude": "7.7848769"
|
||||
},
|
||||
"lock_state": "locked",
|
||||
"system": "Ilockit",
|
||||
"real_hours": "0",
|
||||
"Ilockit_GUID": "00000000-0000-0000-0000-fe3962c08bcc"
|
||||
}
|
||||
},
|
||||
"apiserver": "https://shareeapp-fr01.copri.eu",
|
||||
"uri_primary": "https://shareeapp-primary.copri.eu",
|
||||
"debuglevel": "1",
|
||||
"bike_info_html": "site/bike_info.html",
|
||||
"new_authcoo": "0",
|
||||
"response_state": "OK, nothing todo",
|
||||
"last_used_operator": {
|
||||
"operator_color": "#008dd2",
|
||||
"operator_phone": "+49 089 / 111111111",
|
||||
"operator_email": "hotline@lastenraddemo.bayern",
|
||||
"operator_hours": "Bürozeiten: Montag, Mittwoch, Freitag 9-12 Uhr",
|
||||
"operator_name": "Lastenrad Bayern",
|
||||
"operator_logo": ""
|
||||
},
|
||||
"lang": "DE",
|
||||
"impress_html": "site/impress.html",
|
||||
"tariff_info_html": "site/tariff_info_1.html",
|
||||
"agb_html": "site/agb.html",
|
||||
"response": "user_bikes_occupied",
|
||||
"agb_checked": "1",
|
||||
"privacy_html": "site/privacy.html",
|
||||
"clearing_cache": "0",
|
||||
"user_id": "ohauff@posteo.de"
|
||||
}
|
||||
}
|
1042
TestFramework/Repository/CopriCallsMemory001/StationsAvailable.json
Normal file
|
@ -6,7 +6,7 @@ using TINK.Repository;
|
|||
using TINK.Repository.Request;
|
||||
using TINK.Repository.Response;
|
||||
|
||||
namespace TestTINKLib.Mocks.Connector
|
||||
namespace TestFramework.Repository
|
||||
{
|
||||
/// <summary> Simulates communication errors when connecting to copri.</summary>
|
||||
public class ExceptionServer : ICopriServer
|
|
@ -6,7 +6,7 @@ using TINK.Model.Bike.BluetoothLock;
|
|||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Services.BluetoothLock.Tdo;
|
||||
|
||||
namespace TestTINKLib.Mocks.Services
|
||||
namespace TestFramework.Services.BluetoothLock
|
||||
{
|
||||
public class LocksServiceMock : ILocksService
|
||||
{
|
108
TestFramework/Services/CopriApi/CopriCallsCacheMemory001.cs
Normal file
|
@ -0,0 +1,108 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Model.Services.CopriApi;
|
||||
using TINK.Repository.Response;
|
||||
using TINK.Repository.Request;
|
||||
using TINK.Model.Device;
|
||||
using System.Collections.Generic;
|
||||
using TestFramework.Repository;
|
||||
|
||||
namespace TestFramework.Services.CopriApi.Connector
|
||||
{
|
||||
/// <summary> Allows use of memory for retrieving defined respones.</summary>
|
||||
public class CopriCallsCacheMemory001 : ICopriCache
|
||||
{
|
||||
private CopriCallsMemory001 server;
|
||||
|
||||
public CopriCallsCacheMemory001(string sessionCookie = null)
|
||||
{
|
||||
server = new CopriCallsMemory001(sessionCookie);
|
||||
}
|
||||
|
||||
public bool IsStationsExpired => true;
|
||||
|
||||
public bool IsBikesAvailableExpired => true;
|
||||
|
||||
public bool IsBikesOccupiedExpired => true;
|
||||
|
||||
public bool IsConnected => server.IsConnected;
|
||||
|
||||
public string SessionCookie => server.SessionCookie;
|
||||
|
||||
public string MerchantId => server.MerchantId;
|
||||
|
||||
public void AddToCache(StationsAvailableResponse stations)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public void AddToCache(BikesAvailableResponse bikes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public void AddToCache(BikesReservedOccupiedResponse bikes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public Task<AuthorizationResponse> DoAuthorizationAsync(string p_strMailAddress, string p_strPassword, string p_strDeviceId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<AuthorizationoutResponse> DoAuthoutAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<ReservationBookingResponse> DoReserveAsync(string bikeId, Uri operatorUri)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<ReservationCancelReturnResponse> DoCancelReservationAsync(string p_iBikeId, Uri operatorUri)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<ReservationBookingResponse> CalculateAuthKeysAsync(string bikeId, Uri operatorUri)
|
||||
=> throw new NotSupportedException();
|
||||
|
||||
public Task<ReservationBookingResponse> UpdateLockingStateAsync(string bikeId, LocationDto geolocation, lock_state state, double batteryPercentage, Uri operatorUri)
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
public Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<ReservationCancelReturnResponse> DoReturn(string bikeId, LocationDto location, ISmartDevice smartDevice, Uri operatorUri)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<SubmitFeedbackResponse> DoSubmitFeedback(string bikeId, string message, bool isBikeBroken, Uri operatorUri)
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
/// <summary> Submits mini survey to copri server. </summary>
|
||||
/// <param name="answers">Collection of answers.</param>
|
||||
public Task<ResponseBase> DoSubmitMiniSurvey(IDictionary<string, string> answers)
|
||||
=> throw new NotImplementedException();
|
||||
|
||||
public Task<BikesAvailableResponse> GetBikesAvailableAsync()
|
||||
{
|
||||
return server.GetBikesAvailableAsync();
|
||||
}
|
||||
|
||||
public Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync()
|
||||
{
|
||||
return server.GetBikesOccupiedAsync();
|
||||
}
|
||||
|
||||
public Task<StationsAvailableResponse> GetStationsAsync()
|
||||
{
|
||||
return server.GetStationsAsync();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ using System.Threading.Tasks;
|
|||
using TINK.Model.Services.Geolocation;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TestTINKLib.Mocks.Services
|
||||
namespace TestFramework.Model.Services.Geolocation
|
||||
{
|
||||
public class GeolocationMock : IGeolocation
|
||||
{
|
|
@ -4,7 +4,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TestTINKLib.Mocks.Services
|
||||
namespace TestFramework.Services.Permissions
|
||||
{
|
||||
public class PermissionsMock : IPermissions
|
||||
{
|
35
TestFramework/TestFramework.csproj
Normal file
|
@ -0,0 +1,35 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Repository\CopriCallsMemory001\AuthorizationResponse.json" />
|
||||
<None Remove="Repository\CopriCallsMemory001\AuthoutResponse.json" />
|
||||
<None Remove="Repository\CopriCallsMemory001\BikesOccupiedResponse.json" />
|
||||
<None Remove="Repository\CopriCallsMemory001\StationsAvailable.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Repository\CopriCallsMemory001\AuthorizationResponse.json" />
|
||||
<EmbeddedResource Include="Repository\CopriCallsMemory001\AuthoutResponse.json" />
|
||||
<EmbeddedResource Include="Repository\CopriCallsMemory001\BikesAvailableResponse.json" />
|
||||
<EmbeddedResource Include="Repository\CopriCallsMemory001\BikesOccupiedResponse.json" />
|
||||
<EmbeddedResource Include="Repository\CopriCallsMemory001\StationsAvailable.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Model\Device\" />
|
||||
<Folder Include="Model\User\Account\" />
|
||||
<Folder Include="Services\BluetoothLock\" />
|
||||
<Folder Include="Services\CopriApi\" />
|
||||
<Folder Include="Services\Geolocation\" />
|
||||
<Folder Include="Services\Permissions\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TINKLib\TINKLib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
39
TestFramework/TestHelper.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System.Threading.Tasks;
|
||||
using TINK.Model.Bike;
|
||||
using TINK.Model.User;
|
||||
|
||||
namespace TestFramework
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides helper functionality. Used in TestShareeLib and TestTINKLib.
|
||||
/// </summary>
|
||||
public static class TestHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Eases comparison of xml- files.
|
||||
/// </summary>
|
||||
/// <param name="p_strXmlFile"></param>
|
||||
/// <returns></returns>
|
||||
public static string PrepareXmlForStringCompare(string p_strXmlFile)
|
||||
{
|
||||
return p_strXmlFile.Replace("\r\n", string.Empty).Replace("\t", string.Empty).Replace(" ", string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all bikes at a given station from copri.
|
||||
/// </summary>
|
||||
public static async Task<BikeCollectionMutable> GetBikesAtStation(
|
||||
User user,
|
||||
TINK.Model.Connector.IConnector connector,
|
||||
string selectedStation)
|
||||
{
|
||||
var l_oBikesAtStation = new BikeCollectionMutable();
|
||||
|
||||
var l_oBikesAvailable = (await connector.Query.GetBikesAsync()).Response;
|
||||
|
||||
l_oBikesAtStation.Update(TINK.Model.BikeCollectionFilter.GetAtStation(l_oBikesAvailable, selectedStation));
|
||||
|
||||
return l_oBikesAtStation;
|
||||
}
|
||||
}
|
||||
}
|
24
TestSharee/TestSharee.csproj
Normal file
|
@ -0,0 +1,24 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="UseCase\Startup\TestTinkApp.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="UseCase\Startup\TestTinkApp.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NSubstitute" Version="4.2.2" />
|
||||
<PackageReference Include="NUnit" Version="3.13.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TestFramework\TestFramework.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
37
TestSharee/TestSharee.sln
Normal file
|
@ -0,0 +1,37 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31829.152
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestSharee", "TestSharee.csproj", "{A86E5489-2A44-44C5-8CCF-A2C6777F9E78}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TINKLib", "..\TINKLib\TINKLib.csproj", "{3D53D769-56F1-439E-B237-ADE4A9370F51}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFramework", "..\TestFramework\TestFramework.csproj", "{CA8997CD-32A6-4273-9A2B-451C787208EC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{A86E5489-2A44-44C5-8CCF-A2C6777F9E78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A86E5489-2A44-44C5-8CCF-A2C6777F9E78}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A86E5489-2A44-44C5-8CCF-A2C6777F9E78}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A86E5489-2A44-44C5-8CCF-A2C6777F9E78}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3D53D769-56F1-439E-B237-ADE4A9370F51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3D53D769-56F1-439E-B237-ADE4A9370F51}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3D53D769-56F1-439E-B237-ADE4A9370F51}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3D53D769-56F1-439E-B237-ADE4A9370F51}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CA8997CD-32A6-4273-9A2B-451C787208EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CA8997CD-32A6-4273-9A2B-451C787208EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CA8997CD-32A6-4273-9A2B-451C787208EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CA8997CD-32A6-4273-9A2B-451C787208EC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {9BA7D1A2-6C7D-4569-A23B-C86853F51DCF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -2,24 +2,27 @@
|
|||
using TINK.Model;
|
||||
|
||||
using TINK.Model.User.Account;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TINK.Model.Connector;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using System;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Model.Bike;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TINK.Model.State;
|
||||
using System.Collections.Generic;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TINK.Repository;
|
||||
using TINK.ViewModel.Map;
|
||||
using TINK.ViewModel.Settings;
|
||||
using NSubstitute;
|
||||
using TINK.Services;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TestFramework.Repository;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.Permissions;
|
||||
using NSubstitute;
|
||||
using TestFramework;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.Startup
|
||||
namespace TestShareeLib.UseCases.Startup
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestTinkApp
|
||||
|
@ -34,15 +37,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001()),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -56,10 +59,10 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var l_oStations = l_oTinkApp.GetConnector(true).Query.GetBikesAndStationsAsync().Result.Response;
|
||||
|
||||
// Check stations.
|
||||
Assert.AreEqual(8, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("4"));
|
||||
Assert.AreEqual("4", l_oStations.StationsAll.GetById("4").Id);
|
||||
Assert.AreEqual(new Position(47.6586936667, 9.16863116667), l_oStations.StationsAll.GetById("4").Position);
|
||||
Assert.AreEqual(21, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("KN4")); // Id of station was "4" in former version of COPRI.
|
||||
Assert.AreEqual("KN4", l_oStations.StationsAll.GetById("KN4").Id);
|
||||
Assert.AreEqual(new Position(47.658592, 9.168569), l_oStations.StationsAll.GetById("KN4").Position); // Former position was 47.6586936667, 9.16863116667
|
||||
|
||||
// Verify selected station.
|
||||
Assert.AreEqual(
|
||||
|
@ -88,14 +91,14 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
// User logged in is initial state to verify.
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"), new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new Account("javaminister@gmail.com", "javaminister" /* password */, "4da3044c8657a04ba60e2eaa753bc51a" /* session cookie */, new List<string> { "TINK", "Konrad" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, "4da3044c8657a04ba60e2eaa753bc51a")),
|
||||
new StoreMock(new Account("javaminister@gmail.com", "javaminister" /* password */, "4da3044c8657a04ba60e2eaa753bc51a" /* session cookie */, new List<string> { FilterHelper.FILTERTINKGENERAL, FilterHelper.FILTERKONRAD })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001("6103_112e96b36ba33de245943c5ffaf369cd_")),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -109,10 +112,10 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var l_oStations = l_oTinkApp.GetConnector(true).Query.GetBikesAndStationsAsync().Result.Response;
|
||||
|
||||
// Check stations.
|
||||
Assert.AreEqual(8, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("4"));
|
||||
Assert.AreEqual("4", l_oStations.StationsAll.GetById("4").Id);
|
||||
Assert.AreEqual(new Position(47.6586936667, 9.16863116667), l_oStations.StationsAll.GetById("4").Position);
|
||||
Assert.AreEqual(21, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("KN4"));
|
||||
Assert.AreEqual("KN4", l_oStations.StationsAll.GetById("KN4").Id);
|
||||
Assert.AreEqual(new Position(47.658592, 9.168569), l_oStations.StationsAll.GetById("KN4").Position); // Former position was 47.6586936667, 9.16863116667
|
||||
|
||||
// Verify selected station.
|
||||
Assert.AreEqual(
|
||||
|
@ -129,12 +132,12 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
// Check my bikes
|
||||
var l_oBikes = l_oTinkApp.GetConnector(true).Query.GetBikesOccupiedAsync().Result.Response;
|
||||
Assert.AreEqual(2, l_oBikes.Count);
|
||||
Assert.AreEqual("8", l_oBikes.GetById("8").Id);
|
||||
Assert.AreEqual(InUseStateEnum.Booked, l_oBikes.GetById("8").State.Value);
|
||||
Assert.AreEqual("5", l_oBikes.GetById("8").CurrentStation);
|
||||
Assert.AreEqual(TypeOfBike.Cargo, l_oBikes.GetById("8").TypeOfBike);
|
||||
Assert.AreEqual(WheelType.Two, l_oBikes.GetById("8").WheelType);
|
||||
Assert.AreEqual("7", l_oBikes.GetById("7").Id);
|
||||
Assert.AreEqual("FR1544", l_oBikes.GetById("FR1544").Id); // Bike used here was from set CopriCallsMemory(SampleSets.Set2, 1) and had ID 8
|
||||
Assert.AreEqual(InUseStateEnum.Booked, l_oBikes.GetById("FR1544").State.Value);
|
||||
Assert.AreEqual("FR103", l_oBikes.GetById("FR1544").CurrentStation); // // Bike used here was at station 5
|
||||
Assert.That(l_oBikes.GetById("FR1544").TypeOfBike, Is.Null); // Bike used here was TypeOfBike.Cargo
|
||||
Assert.That(l_oBikes.GetById("FR1544").WheelType, Is.Null); // Bike was of Type WheelType.Two
|
||||
Assert.AreEqual("FR1004", l_oBikes.GetById("FR1004").Id);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -148,15 +151,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
// No user logged in is initial state to verify.
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://app.tink-konstanz.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new Account("mgrimm@gmail.com", "123456789" /* password */, "1234" /* session cookie */, new List<string> { "TINK", "Konrad" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
new StoreMock(new Account("mgrimm@gmail.com", "123456789" /* password */, "1234" /* session cookie */, new List<string> { FilterHelper.FILTERTINKGENERAL, FilterHelper.FILTERKONRAD })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001()),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -170,10 +173,10 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var l_oStations = l_oTinkApp.GetConnector(true).Query.GetBikesAndStationsAsync().Result.Response;
|
||||
|
||||
// Check stations.
|
||||
Assert.AreEqual(8, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("4"));
|
||||
Assert.AreEqual("4", l_oStations.StationsAll.GetById("4").Id);
|
||||
Assert.AreEqual(new Position(47.6586936667, 9.16863116667), l_oStations.StationsAll.GetById("4").Position);
|
||||
Assert.AreEqual(21, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("KN4"));
|
||||
Assert.AreEqual("KN4", l_oStations.StationsAll.GetById("KN4").Id);
|
||||
Assert.AreEqual(new Position(47.658592, 9.168569), l_oStations.StationsAll.GetById("KN4").Position); // Former position was 47.6586936667, 9.16863116667
|
||||
|
||||
// Verify selected station.
|
||||
Assert.AreEqual(
|
||||
|
@ -203,15 +206,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
// No user logged in is initial state to verify.
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://app.tink-konstanz.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new Account("mgrimm@gmail.com", "123456789" /* password */, "1234" /* session cookie */, new List<string> { "TINK", "Konrad" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
new StoreMock(new Account("mgrimm@gmail.com", "123456789" /* password */, "1234" /* session cookie */, new List<string> { FilterHelper.FILTERTINKGENERAL, FilterHelper.FILTERKONRAD })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001()),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -225,10 +228,10 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var l_oStations = l_oTinkApp.GetConnector(true).Query.GetBikesAndStationsAsync().Result.Response;
|
||||
|
||||
// Check stations.
|
||||
Assert.AreEqual(2, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("14"));
|
||||
Assert.AreEqual("14", l_oStations.StationsAll.GetById("14").Id);
|
||||
Assert.AreEqual(new Position(47.66698054007847, 9.169303178787231), l_oStations.StationsAll.GetById("14").Position);
|
||||
Assert.AreEqual(27, l_oStations.StationsAll.Count);
|
||||
Assert.NotNull(l_oStations.StationsAll.GetById("KN1")); // Former station id was 14 when bike was read from CopriCallsMemory(SampleSets.Set2, 1)
|
||||
Assert.AreEqual("KN1", l_oStations.StationsAll.GetById("KN1").Id);
|
||||
Assert.AreEqual(new Position(47.66267, 9.17262), l_oStations.StationsAll.GetById("KN1").Position); // Former station was 47.66698054007847, 9.169303178787231
|
||||
|
||||
// Verify selected station.
|
||||
Assert.AreEqual(
|
|
@ -1,6 +1,8 @@
|
|||
using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using TestFramework;
|
||||
using TestShareeLib;
|
||||
using TINK.Model.State;
|
||||
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ using TINK.Model.User.Account;
|
|||
using Plugin.Permissions.Abstractions;
|
||||
|
||||
using TestShareeLib.Repository;
|
||||
using TestFramework.Repository;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.Logout
|
||||
{
|
||||
|
@ -56,7 +57,7 @@ namespace TestTINKLib.Fixtures.UseCases.Logout
|
|||
Assert.IsTrue(l_oTinkApp.ActiveUser.IsLoggedIn);
|
||||
// There are 6 bikes available and 2, one reserved and one rented by javaminsiter.
|
||||
Assert.AreEqual(
|
||||
8,
|
||||
10,
|
||||
l_oTinkApp.GetConnector(true).Query.GetBikesAsync().Result.Response.Count,
|
||||
"Sum of bikes is 6 occupied plus 2 occupied.");
|
||||
Assert.AreEqual(2,
|
||||
|
@ -70,7 +71,7 @@ namespace TestTINKLib.Fixtures.UseCases.Logout
|
|||
|
||||
Assert.IsFalse(l_oTinkApp.ActiveUser.IsLoggedIn);
|
||||
Assert.AreEqual(
|
||||
6,
|
||||
8,
|
||||
l_oTinkApp.GetConnector(true).Query.GetBikesAsync().Result.Response.Count,
|
||||
"Sum of bikes is 6 occupied, no one occupied because no user is logged in");
|
||||
Assert.AreEqual(
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
using System;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Repository;
|
||||
using TINK.Model.Services.CopriApi.ServerUris;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TINK.Services;
|
||||
using NSubstitute;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
|
@ -13,9 +11,9 @@ using TINK.Model.Device;
|
|||
using TINK.Model.User.Account;
|
||||
using Plugin.Permissions.Abstractions;
|
||||
using System.Threading.Tasks;
|
||||
using TestShareeLib.Repository;
|
||||
using TestFramework.Repository;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.Login
|
||||
namespace TestShareeLib.UseCases.Login
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestTinkApp
|
||||
|
@ -51,7 +49,7 @@ namespace TestTINKLib.Fixtures.UseCases.Login
|
|||
|
||||
Assert.IsFalse(l_oTinkApp.ActiveUser.IsLoggedIn);
|
||||
Assert.AreEqual(
|
||||
6,
|
||||
8,
|
||||
l_oTinkApp.GetConnector(true).Query.GetBikesAsync().Result.Response.Count,
|
||||
"Sum of bikes is 6 occupied, no one occupied because no user is logged in");
|
||||
Assert.AreEqual(
|
||||
|
@ -66,7 +64,7 @@ namespace TestTINKLib.Fixtures.UseCases.Login
|
|||
|
||||
Assert.IsTrue(l_oTinkApp.ActiveUser.IsLoggedIn);
|
||||
Assert.AreEqual(
|
||||
8,
|
||||
10,
|
||||
l_oTinkApp.GetConnector(true).Query.GetBikesAsync().Result.Response.Count,
|
||||
"Sum of bikes is 6 occupied plus 2 occupied.");
|
||||
Assert.AreEqual(
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
namespace TestTINKLib
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides helper functionality. Used in TestShareeLib and TestTINKLib.
|
||||
/// </summary>
|
||||
public static class TestHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Eases comparison of xml- files.
|
||||
/// </summary>
|
||||
/// <param name="p_strXmlFile"></param>
|
||||
/// <returns></returns>
|
||||
public static string PrepareXmlForStringCompare(string p_strXmlFile)
|
||||
{
|
||||
return p_strXmlFile.Replace("\r\n", string.Empty).Replace("\t", string.Empty).Replace(" ", string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,6 +34,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TestFramework\TestFramework.csproj" />
|
||||
<ProjectReference Include="..\TINKLib\TINKLib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestShareeLib", "TestSharee
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TINKLib", "..\TINKLib\TINKLib.csproj", "{F3C0288B-7527-42B0-AA43-CC461766D6E1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFramework", "..\TestFramework\TestFramework.csproj", "{F86692DF-BCB9-4236-8337-04CB65EE4256}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -21,6 +23,10 @@ Global
|
|||
{F3C0288B-7527-42B0-AA43-CC461766D6E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F3C0288B-7527-42B0-AA43-CC461766D6E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F3C0288B-7527-42B0-AA43-CC461766D6E1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F86692DF-BCB9-4236-8337-04CB65EE4256}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F86692DF-BCB9-4236-8337-04CB65EE4256}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F86692DF-BCB9-4236-8337-04CB65EE4256}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F86692DF-BCB9-4236-8337-04CB65EE4256}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -31,10 +31,10 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector.Filter
|
|||
[Test]
|
||||
public void TestDoFilter()
|
||||
{
|
||||
var filter = new IntersectGroupFilter(new List<string> { "Tonk", "Honk" });
|
||||
var filter = new IntersectGroupFilter(new List<string> { "FR_001", "FR_009" });
|
||||
|
||||
Assert.AreEqual(1, filter.DoFilter(new List<string> { "Tonk", "Klonk" }).Count());
|
||||
Assert.AreEqual("Tonk", filter.DoFilter(new List<string> { "Tonk", "Klonk" }).ToArray()[0]);
|
||||
Assert.AreEqual(1, filter.DoFilter(new List<string> { "FR_001", "FR_007" }).Count());
|
||||
Assert.AreEqual("FR_001", filter.DoFilter(new List<string> { "FR_001", "FR_007" }).ToArray()[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||
using TINK.Model.Connector;
|
||||
using System.Linq;
|
||||
using TINK.Repository;
|
||||
using TestFramework.Repository;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
||||
{
|
||||
|
@ -15,34 +16,34 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
[Test]
|
||||
public void TestGetStationsAll()
|
||||
{
|
||||
var l_oConnector = new ConnectorCache(
|
||||
var connector = new ConnectorCache(
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory(CopriCallsMemory.SampleSets.Set2, 1));
|
||||
new CopriCallsMemory001());
|
||||
|
||||
var l_oFilter = new FilteredConnector(new List<string> { "TINK", "Konrad" }, l_oConnector);
|
||||
var l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(9, l_oStations.StationsAll.Count());
|
||||
var filter = new FilteredConnector(new List<string> { FilterHelper.FILTERTINKGENERAL, FilterHelper.FILTERKONRAD }, connector);
|
||||
var stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(41, stations.StationsAll.Count()); // Count of stations was 9 before switching to data provider CopriCallsMemory(CopriCallsMemory.SampleSets.Set2, 1)
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "TINK" }, l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(8, l_oStations.StationsAll.Count());
|
||||
filter = new FilteredConnector(new List<string> { FilterHelper.FILTERTINKGENERAL }, connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(21, stations.StationsAll.Count());
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "Konrad" }, l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(2, l_oStations.StationsAll.Count());
|
||||
filter = new FilteredConnector(new List<string> { FilterHelper.FILTERKONRAD }, connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(27, stations.StationsAll.Count());
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "AGroupNamedNonsensDoesNotExist" }, l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(0, l_oStations.StationsAll.Count());
|
||||
filter = new FilteredConnector(new List<string> { "AGroupNamedNonsensDoesNotExist" }, connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(0, stations.StationsAll.Count());
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string>(), l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(9, l_oStations.StationsAll.Count());
|
||||
filter = new FilteredConnector(new List<string>(), connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(41, stations.StationsAll.Count());
|
||||
|
||||
l_oFilter = new FilteredConnector(null, l_oConnector);
|
||||
l_oStations = l_oFilter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(9, l_oStations.StationsAll.Count(), "Null means filter none.");
|
||||
filter = new FilteredConnector(null, connector);
|
||||
stations = filter.Query.GetBikesAndStationsAsync().Result.Response;
|
||||
Assert.AreEqual(41, stations.StationsAll.Count(), "Null means filter none.");
|
||||
}
|
||||
|
||||
/// <summary> Tests all stations. </summary>
|
||||
|
@ -52,19 +53,19 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
var l_oConnector = new ConnectorCache(
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory(CopriCallsMemory.SampleSets.Set2, 1));
|
||||
new CopriCallsMemory001());
|
||||
|
||||
var l_oFilter = new FilteredConnector(new List<string> { "TINK", "Konrad" }, l_oConnector);
|
||||
var l_oFilter = new FilteredConnector(new List<string> { FilterHelper.FILTERTINKGENERAL, FilterHelper.FILTERKONRAD }, l_oConnector);
|
||||
var l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(12, l_oBikes.Count());
|
||||
Assert.AreEqual(8, l_oBikes.Count()); // Count of stations was 12 CopriCallsMemory(CopriCallsMemory.SampleSets.Set2, 1)
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "TINK" }, l_oConnector);
|
||||
l_oFilter = new FilteredConnector(new List<string> { FilterHelper.FILTERTINKGENERAL }, l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(11, l_oBikes.Count());
|
||||
Assert.AreEqual(5, l_oBikes.Count()); // Was 11
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "Konrad" }, l_oConnector);
|
||||
l_oFilter = new FilteredConnector(new List<string> { FilterHelper.FILTERKONRAD }, l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(1, l_oBikes.Count());
|
||||
Assert.AreEqual(3, l_oBikes.Count()); // Was 1
|
||||
|
||||
l_oFilter = new FilteredConnector(new List<string> { "AGroupNamedNonsensDoesNotExist" }, l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
|
@ -72,11 +73,11 @@ namespace TestTINKLib.Fixtures.ObjectTests.Connector
|
|||
|
||||
l_oFilter = new FilteredConnector(new List<string>(), l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(12, l_oBikes.Count(), "List with zero element means filter all.");
|
||||
Assert.AreEqual(8, l_oBikes.Count(), "List with zero element means filter all."); // Was 12
|
||||
|
||||
l_oFilter = new FilteredConnector(null, l_oConnector);
|
||||
l_oBikes = l_oFilter.Query.GetBikesAsync().Result.Response;
|
||||
Assert.AreEqual(12, l_oBikes.Count(), "Null means filter none.");
|
||||
Assert.AreEqual(8, l_oBikes.Count(), "Null means filter none.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -342,18 +342,21 @@ namespace TestTINKLib.Fixtures.Connector
|
|||
[Test]
|
||||
public void TestGetAuthGroup()
|
||||
{
|
||||
var l_oResponse = JsonConvertRethrow.DeserializeObject<AuthorizationResponse>(@"
|
||||
// User group was of format [ ""TINK"", ""Konrad"" ] in early day...
|
||||
// Since COPRI 4.1 use group is no more used.
|
||||
// Groups are of format <OperatorId>_<BikeType> for this user group would be like below if it would be used.
|
||||
var response = JsonConvertRethrow.DeserializeObject<AuthorizationResponse>(@"
|
||||
{
|
||||
""response"" : ""authorization"",
|
||||
""authcookie"" : ""4da3044c8657a04ba60e2eaa753bc51a"",
|
||||
""user_group"" : [ ""TINK"", ""Konrad"" ],
|
||||
""user_group"" : [ ""KN_300102"", ""KN_300101"" ],
|
||||
""response_state"" : ""OK"",
|
||||
""apiserver"" : ""https://tinkwwp.copri-bike.de""
|
||||
}");
|
||||
|
||||
Assert.AreEqual(2, l_oResponse.GetGroup().ToList().Count);
|
||||
Assert.AreEqual(FilterHelper.FILTERTINKGENERAL, l_oResponse.GetGroup().ToList()[0]);
|
||||
Assert.AreEqual("Konrad", l_oResponse.GetGroup().ToList()[1]);
|
||||
Assert.AreEqual(2, response.GetGroup().ToList().Count);
|
||||
Assert.AreEqual($"KN_300102", response.GetGroup().ToList()[0]);
|
||||
Assert.AreEqual($"KN_300101", response.GetGroup().ToList()[1]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using NUnit.Framework;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.ViewModel.Map;
|
||||
|
||||
namespace UITest.Fixtures.ObjectTests.Map
|
||||
|
@ -19,23 +19,23 @@ namespace UITest.Fixtures.ObjectTests.Map
|
|||
[Test]
|
||||
public void TestCurrentFilter()
|
||||
{
|
||||
var l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }));
|
||||
var l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.On }, { "Konrad", FilterState.Off } }));
|
||||
|
||||
Assert.AreEqual("TINK", l_oFilter.CurrentFilter);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERTINKGENERAL}", l_oFilter.CurrentFilter);
|
||||
|
||||
l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }));
|
||||
l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.Off }, { $"HOM_{ FilterHelper.FILTERKONRAD}", FilterState.On } }));
|
||||
|
||||
Assert.AreEqual("Konrad", l_oFilter.CurrentFilter);
|
||||
Assert.AreEqual($"HOM_{ FilterHelper.FILTERKONRAD}", l_oFilter.CurrentFilter);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestIsToggleVisible()
|
||||
{
|
||||
var l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }));
|
||||
var l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.On } }));
|
||||
|
||||
Assert.IsFalse(l_oFilter.IsToggleVisible);
|
||||
|
||||
l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }));
|
||||
l_oFilter = new TinkKonradToggleViewModel(new GroupFilterMapPage(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.Off }, { $"HOM_{ FilterHelper.FILTERKONRAD}", FilterState.On } }));
|
||||
|
||||
Assert.IsTrue(l_oFilter.IsToggleVisible);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.ViewModel.Settings;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
||||
|
@ -12,12 +13,12 @@ namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
|||
[Test]
|
||||
public void TestDoFilter()
|
||||
{
|
||||
var l_oFilter = new GroupFilterSettings(new Dictionary<string, FilterState> { { "Konrad", FilterState.Off }, { "TINK", FilterState.On }, { "FutureBikeType", FilterState.On} });
|
||||
var l_oFilter = new GroupFilterSettings(new Dictionary<string, FilterState> { { $"HOM_{FilterHelper.FILTERKONRAD}", FilterState.Off }, { $"HOM_{FilterHelper.FILTERTINKGENERAL}", FilterState.On }, { "HOM_117025", FilterState.On} });
|
||||
|
||||
var l_oResult = l_oFilter.DoFilter(new List<string> { "Konrad", "TINK" });
|
||||
var l_oResult = l_oFilter.DoFilter(new List<string> { $"HOM_{FilterHelper.FILTERKONRAD}", $"HOM_{FilterHelper.FILTERTINKGENERAL}" });
|
||||
|
||||
Assert.AreEqual(1, l_oResult.ToList().Count);
|
||||
Assert.AreEqual("TINK", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERTINKGENERAL}", l_oResult.ToList()[0]);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,12 @@
|
|||
using NUnit.Framework;
|
||||
using Serilog.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Services.CopriApi.ServerUris;
|
||||
using TINK.Settings;
|
||||
using TINK.ViewModel.Map;
|
||||
using TINK.ViewModel.Settings;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
||||
{
|
||||
|
@ -17,9 +20,11 @@ namespace TestTINKLib.Fixtures.ObjectTests.Settings
|
|||
|
||||
Assert.AreEqual(LogEventLevel.Error, settings.MinimumLogEventLevel);
|
||||
|
||||
Assert.AreEqual(GroupFilterHelper.GetSettingsFilterDefaults, settings.GroupFilterSettings);
|
||||
// Was GroupFilterHelper.GetSettingsFilterDefaults when used in TINK- context.
|
||||
Assert.AreEqual(new GroupFilterSettings(), settings.GroupFilterSettings);
|
||||
|
||||
Assert.AreEqual(GroupFilterHelper.GetMapPageFilterDefaults, settings.GroupFilterMapPage);
|
||||
// Was GroupFilterHelper.GetMapPageFilterDefaults when used in TINK- context.
|
||||
Assert.AreEqual(new GroupFilterMapPage(), settings.GroupFilterMapPage);
|
||||
|
||||
Assert.AreEqual(new CopriServerUriList().ActiveUri, settings.ActiveUri);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using Rhino.Mocks;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.User.Account;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.User.Account
|
||||
|
@ -17,16 +18,16 @@ namespace TestTINKLib.Fixtures.ObjectTests.User.Account
|
|||
|
||||
l_oAccount.Stub((x) => x.Mail).Return("a@b");
|
||||
l_oAccount.Stub((x) => x.SessionCookie).Return(""); // User is not logged in
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { "TINK", "FutureType" });
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { $"HOM_{FilterHelper.FILTERTINKGENERAL}", "HOM_117025" });
|
||||
|
||||
var l_oSource = new List<string> { "TINK", "Konrad", "FutureType" };
|
||||
var l_oSource = new List<string> { $"HOM_{FilterHelper.FILTERTINKGENERAL}", $"HOM_{FilterHelper.FILTERKONRAD}", "HOM_117025" };
|
||||
|
||||
var l_oResult = l_oAccount.DoFilter(l_oSource);
|
||||
|
||||
Assert.AreEqual(3, l_oResult.ToList().Count);
|
||||
Assert.AreEqual("TINK", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual("Konrad", l_oResult.ToList()[1]);
|
||||
Assert.AreEqual("FutureType", l_oResult.ToList()[2]);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERTINKGENERAL}", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERKONRAD}", l_oResult.ToList()[1]);
|
||||
Assert.AreEqual("HOM_117025", l_oResult.ToList()[2]);
|
||||
}
|
||||
/// <summary> </summary>
|
||||
[Test]
|
||||
|
@ -36,15 +37,15 @@ namespace TestTINKLib.Fixtures.ObjectTests.User.Account
|
|||
|
||||
l_oAccount.Stub((x) => x.Mail).Return("a@b");
|
||||
l_oAccount.Stub((x) => x.SessionCookie).Return("123");
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { "TINK", "FutureType" });
|
||||
l_oAccount.Stub((x) => x.Group).Return(new List<string> { $"HOM_{FilterHelper.FILTERTINKGENERAL}", "HOM_117025" });
|
||||
|
||||
var l_oSource = new List<string> { "TINK", "Konrad", "FutureType" };
|
||||
var l_oSource = new List<string> { $"HOM_{FilterHelper.FILTERTINKGENERAL}", $"HOM_{FilterHelper.FILTERKONRAD}", "HOM_117025" };
|
||||
|
||||
var l_oResult = l_oAccount.DoFilter(l_oSource);
|
||||
|
||||
Assert.AreEqual(2, l_oResult.ToList().Count);
|
||||
Assert.AreEqual("TINK", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual("FutureType", l_oResult.ToList()[1]);
|
||||
Assert.AreEqual($"HOM_{FilterHelper.FILTERTINKGENERAL}", l_oResult.ToList()[0]);
|
||||
Assert.AreEqual("HOM_117025", l_oResult.ToList()[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Model.User;
|
||||
using TINK.Model.Connector;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
|
||||
using TINK.Model.User.Account;
|
||||
using System.Collections.Generic;
|
||||
using TINK.Repository;
|
||||
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TestFramework.Model.User.Account;
|
||||
|
||||
namespace TestTINKLib
|
||||
{
|
||||
|
|
|
@ -4,9 +4,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using TestTINKLib.Mocks.Connector;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Repository.Exception;
|
||||
|
@ -14,7 +11,6 @@ using TINK.View;
|
|||
using TINK.Model.Services.CopriApi;
|
||||
using TINK.Repository;
|
||||
|
||||
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TINK.ViewModel.Map;
|
||||
using TINK.ViewModel.Settings;
|
||||
|
@ -22,6 +18,13 @@ using TINK.ViewModel.Account;
|
|||
using TINK.Services;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using NSubstitute;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Repository;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TestFramework.Services.Permissions;
|
||||
using TestFramework.Services.CopriApi.Connector;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Account
|
||||
{
|
||||
|
@ -101,7 +104,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
|
||||
await settingsPageViewModel.OnAppearing();
|
||||
|
||||
Assert.AreEqual("Logged in as a@b at TINK.", settingsPageViewModel.LoggedInInfo);
|
||||
Assert.AreEqual("Logged in as a@b.", settingsPageViewModel.LoggedInInfo);
|
||||
Assert.IsFalse(settingsPageViewModel.IsBookingStateInfoVisible, "A user is logged but no bikes requested/ booked.");
|
||||
Assert.AreEqual(string.Empty, settingsPageViewModel.BookingStateInfo);
|
||||
}
|
||||
|
@ -118,8 +121,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "4da3044c8657a04ba60e2eaa753bc51a", new List<string> { "TINK" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "6103_112e96b36ba33de245943c5ffaf369cd_", new List<string> { "TINK" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -140,7 +143,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
|
||||
await settingsPageViewModel.OnAppearing();
|
||||
|
||||
Assert.AreEqual("Logged in as a@b at TINK.", settingsPageViewModel.LoggedInInfo);
|
||||
Assert.AreEqual("Logged in as a@b.", settingsPageViewModel.LoggedInInfo);
|
||||
Assert.IsTrue(settingsPageViewModel.IsBookingStateInfoVisible, "A user is logged but no bikes requested/ booked.");
|
||||
Assert.AreEqual("Aktuell 2 Fahrräder reserviert/ gebucht.", settingsPageViewModel.BookingStateInfo);
|
||||
}
|
||||
|
@ -157,8 +160,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "4da3044c8657a04ba60e2eaa753bc51a", new List<string> { "TINK" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "6103_112e96b36ba33de245943c5ffaf369cd_", new List<string> { "TINK" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -179,7 +182,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
|
||||
await settingsPageViewModel.OnAppearing();
|
||||
|
||||
Assert.AreEqual("Logged in as a@b at TINK.", settingsPageViewModel.LoggedInInfo);
|
||||
Assert.AreEqual("Logged in as a@b.", settingsPageViewModel.LoggedInInfo);
|
||||
Assert.IsTrue(settingsPageViewModel.IsBookingStateInfoVisible, "A user is logged but no bikes requested/ booked.");
|
||||
Assert.AreEqual("Aktuell 2 Fahrräder reserviert/ gebucht. Verbindungsstatus: Offline.", settingsPageViewModel.BookingStateInfo);
|
||||
}
|
||||
|
@ -196,7 +199,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "4da3044c8657a04ba60e2eaa753bc51a", new List<string> { "TINK" })),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("a@b", "123456789", "6103_112e96b36ba33de245943c5ffaf369cd_", new List<string> { "TINK" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new TINK.Model.Connector.Connector(
|
||||
uri,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
|
@ -207,7 +210,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
TinkApp.MerchantId,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
sessionCookie: sessionCookie,
|
||||
cacheServer: new CopriCallsCacheMemory(SampleSets.Set2, sessionCookie: sessionCookie),
|
||||
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
|
||||
httpsServer: new ExceptionServer((msg) => new WebConnectFailureException(msg, new Exception("Source expection."))))),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
|
@ -229,7 +232,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
|
||||
await settingsPageViewModel.OnAppearing();
|
||||
|
||||
Assert.AreEqual("Logged in as a@b at TINK.", settingsPageViewModel.LoggedInInfo);
|
||||
Assert.AreEqual("Logged in as a@b.", settingsPageViewModel.LoggedInInfo); // CopriCallsCacheMemory(SampleSets.Set2,
|
||||
Assert.IsTrue(settingsPageViewModel.IsBookingStateInfoVisible, "A user is logged but no bikes requested/ booked.");
|
||||
Assert.AreEqual("Aktuell 2 Fahrräder reserviert/ gebucht. Verbindungsstatus: Offline.", settingsPageViewModel.BookingStateInfo);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
using Rhino.Mocks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TINK.Model.Bike.BluetoothLock;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.State;
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TestTINKLib.Mocks.Connector;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Repository.Exception;
|
||||
using TINK.Model.Services.CopriApi;
|
||||
using TINK.Repository;
|
||||
using TINK.View;
|
||||
using TINK.ViewModel.Map;
|
||||
using Xamarin.Forms;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TINK.ViewModel.Settings;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Services;
|
||||
using NSubstitute;
|
||||
using TINK.Services.Permissions;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Services.Permissions;
|
||||
using TestFramework.Repository;
|
||||
using TestFramework.Services.CopriApi.Connector;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.Startup
|
||||
namespace TestShareeLib.UseCases.Startup
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
|
@ -34,15 +34,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -55,8 +55,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
lastVersion: new Version(3, 0, 173), // Current app version. Must be larger or equal 3.0.173 to
|
||||
whatsNewShownInVersion: null); // Whats new page was never shown.
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -77,13 +77,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(21, viewModel.Pins.Count); // Were 8 pins when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag,
|
||||
Is.EqualTo("FR105"),
|
||||
"Station FR105 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag,
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike."); // Was station id 31
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsTrue(viewModel.IsToggleVisible, "TINK and Konrad are activated in settings.");
|
||||
|
@ -109,15 +111,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.Off }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -130,8 +132,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
lastVersion: new Version(3, 0, 173), // Current app version. Must be larger or equal 3.0.173 to
|
||||
whatsNewShownInVersion: null); // Whats new page was never shown.
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -152,13 +154,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(2, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Green"),
|
||||
"Station 5 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "14").Icon.Id.Contains("Red"),
|
||||
"Station 14 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(27, viewModel.Pins.Count); // Were 2 pins when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag, // Was station 5
|
||||
Is.EqualTo("FR101"),
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was station 14
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsTrue(viewModel.IsToggleVisible, "TINK and Konrad are activated in settings.");
|
||||
|
@ -176,22 +180,20 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Test]
|
||||
public async Task TestConstruct_KonradOnly()
|
||||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.Off }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -202,8 +204,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -211,8 +213,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -224,13 +226,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(2, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Green"),
|
||||
"Station 5 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "14").Icon.Id.Contains("Red"),
|
||||
"Station 14 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(27, viewModel.Pins.Count); // Were 2 when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag, // Was station id 31
|
||||
Is.EqualTo("FR101"),
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was 14
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsFalse(viewModel.IsToggleVisible, "TINK and Konrad is deactivated from settings.");
|
||||
|
@ -250,15 +254,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001( sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -269,8 +273,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173));
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -278,8 +282,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -291,13 +295,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(21, viewModel.Pins.Count); // Were 8 pin when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag,
|
||||
Is.EqualTo("FR103"), // Was station id 4
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was 31
|
||||
Is.EqualTo("KN12"), // Was station id 31
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsFalse(viewModel.IsToggleVisible, "TINK and Konrad is deactivated from settings.");
|
||||
|
@ -317,15 +323,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001( sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
|
@ -336,8 +342,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -345,8 +351,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -358,13 +364,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
Assert.IsNull(viewModel.Exception);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(21, viewModel.Pins.Count); // Were 8 pins when loading from CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag, // Was station id 4
|
||||
Is.EqualTo("FR103"),
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was 31
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsTrue(viewModel.IsToggleVisible, "TINK and Konrad are activated in settings.");
|
||||
|
@ -386,8 +394,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -405,7 +413,7 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
TinkApp.MerchantId,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
sessionCookie: sessionCookie,
|
||||
cacheServer: new CopriCallsCacheMemory(sessionCookie: sessionCookie),
|
||||
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
|
||||
httpsServer: new ExceptionServer((msg) => new WebConnectFailureException(msg, new Exception("Source expection."))))),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
|
@ -417,8 +425,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -426,8 +434,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -441,13 +449,15 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
viewModel.Exception.Message);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
Assert.AreEqual(21, viewModel.Pins.Count);
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Green")).Tag, // Was station id 4
|
||||
Is.EqualTo("FR103"),
|
||||
"Station FR101 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Icon.Id.Contains("Open_Red")).Tag, // Was 31
|
||||
Is.EqualTo("KN12"),
|
||||
"Station KN12 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
Assert.IsTrue(viewModel.IsToggleVisible, "TINK and Konrad are activated in settings.");
|
||||
|
@ -463,14 +473,13 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public async Task TestConstruct_GeneralPurposeCommunicationError()
|
||||
{
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -488,7 +497,7 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
TinkApp.MerchantId,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
sessionCookie: sessionCookie,
|
||||
cacheServer: new CopriCallsCacheMemory(sessionCookie: sessionCookie),
|
||||
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
|
||||
httpsServer: new ExceptionServer((msg) => new Exception(msg)))),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
|
@ -501,8 +510,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
||||
|
||||
var viewService = MockRepository.GenerateStub<IViewService>();
|
||||
var navigationService = MockRepository.GenerateStub<INavigation>();
|
||||
var viewService = Substitute.For<IViewService>();
|
||||
var navigationService = Substitute.For<INavigation>();
|
||||
var locationPermission = Substitute.For<ILocationPermission>();
|
||||
|
||||
locationPermission.CheckStatusAsync().Returns(Status.Granted);
|
||||
|
@ -510,8 +519,8 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
var viewModel = new MapPageViewModel(
|
||||
tinkApp,
|
||||
locationPermission,
|
||||
NSubstitute.Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
NSubstitute.Substitute.For<IGeolocation>(),
|
||||
Substitute.For<Plugin.BLE.Abstractions.Contracts.IBluetoothLE>(),
|
||||
Substitute.For<IGeolocation>(),
|
||||
(mapspan) => { },
|
||||
viewService,
|
||||
navigationService);
|
||||
|
@ -525,12 +534,14 @@ namespace TestTINKLib.Fixtures.UseCases.Startup
|
|||
viewModel.Exception.Message);
|
||||
|
||||
// Verify pins on map
|
||||
Assert.AreEqual(8, viewModel.Pins.Count);
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "4").Icon.Id.Contains("Green"),
|
||||
"Station 4 must be marked green because there is are bike.");
|
||||
Assert.IsTrue(
|
||||
viewModel.Pins.FirstOrDefault(pin => pin.Tag.ToString() == "31").Icon.Id.Contains("Red"),
|
||||
Assert.AreEqual(21, viewModel.Pins.Count);
|
||||
Assert.That(
|
||||
viewModel.Pins.Where(pin => pin.Icon.Id.Contains("Open_Green")).Select(pin => pin.Tag.ToString()),
|
||||
Does.Contain("FR103"), // Was station id 4
|
||||
"Station FR103 must be marked green because there is are bike.");
|
||||
Assert.That(
|
||||
viewModel.Pins.Where(pin => pin.Icon.Id.Contains("Open_Red")).Select(pin => pin.Tag.ToString()),
|
||||
Does.Contain("KN12"), // Was station id 31
|
||||
"Station 31 must be marked red because there is no bike.");
|
||||
|
||||
// Verify buttons
|
||||
|
|
|
@ -4,7 +4,6 @@ using TINK.Model.Bike;
|
|||
using TINK.Model.User;
|
||||
using TINK.Model.User.Account;
|
||||
using TINK.ViewModel;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
|
||||
using Xamarin.Forms;
|
||||
using TINK.Model.State;
|
||||
|
@ -14,6 +13,7 @@ using System.Collections.Generic;
|
|||
using BikeInfoMutable = TINK.Model.Bike.BC.BikeInfoMutable;
|
||||
using TINK.ViewModel.Bikes;
|
||||
using TINK.Model.Device;
|
||||
using TestFramework.Model.User.Account;
|
||||
|
||||
namespace UITest.Fixtures.ViewModel
|
||||
{
|
||||
|
|
|
@ -3,13 +3,12 @@ using System;
|
|||
using TINK.Model.Bike;
|
||||
using TINK.Model.User;
|
||||
using TINK.Model.User.Account;
|
||||
using TINK.ViewModel;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using TINK.Model.State;
|
||||
using System.Collections.Generic;
|
||||
using TINK.Repository;
|
||||
using TINK.ViewModel.Bikes.Bike;
|
||||
using TestFramework.Model.User.Account;
|
||||
|
||||
namespace UITest.Fixtures.ViewModel
|
||||
{
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using NUnit.Framework;
|
||||
using Rhino.Mocks;
|
||||
using System;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.User;
|
||||
using TINK.ViewModel;
|
||||
|
|
|
@ -3,10 +3,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TestTINKLib.Mocks.Connector;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Repository.Exception;
|
||||
|
@ -28,6 +24,12 @@ using TINK.Model.Services.Geolocation;
|
|||
using NSubstitute.ExceptionExtensions;
|
||||
using TINK.Services;
|
||||
using TINK.Model.Device;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Repository;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.Permissions;
|
||||
using TestFramework.Services.CopriApi.Connector;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
||||
{
|
||||
|
@ -46,15 +48,15 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: locksService.GetType().FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("", null, null, new List<string> ())),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.ShareeFr01_Set1, 1, sessionCookie)),
|
||||
new StoreMock(new TINK.Model.User.Account.Account("", null, null, new List<string>())),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
geolocation,
|
||||
locksService,
|
||||
new DeviceMock(),
|
||||
|
@ -72,7 +74,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.Android,
|
||||
new TINK.Model.Station.Station("103", new List<string>(), null), // Station 103
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 103 before switching from data provider CopriCallsMemory(SampleSets.ShareeFr01_Set1, 1, ...)
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
geolocation.Active, // geolocation
|
||||
|
@ -92,13 +94,13 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
var bike1315 = bikesAtStation.FirstOrDefault(x => x.Id == "1315") as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel;
|
||||
var bike1543 = bikesAtStation.FirstOrDefault(x => x.Id == "1543") as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel;
|
||||
var bikeFR9999 = bikesAtStation.FirstOrDefault(x => x.Id == "FR9999") as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel; // Was id 1315
|
||||
var bikeFR9998 = bikesAtStation.FirstOrDefault(x => x.Id == "FR9998") as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel; // Was id 1543
|
||||
|
||||
Assert.AreEqual("Available.", bike1315.StateText);
|
||||
Assert.AreEqual("Available.", bike1543.StateText);
|
||||
Assert.AreEqual("NotLoggedIn", bike1315.LockitButtonText);
|
||||
Assert.AreEqual("NotLoggedIn", bike1543.LockitButtonText);
|
||||
Assert.AreEqual("Available.", bikeFR9999.StateText);
|
||||
Assert.AreEqual("Available.", bikeFR9998.StateText);
|
||||
Assert.AreEqual("NotLoggedIn", bikeFR9999.LockitButtonText);
|
||||
Assert.AreEqual("NotLoggedIn", bikeFR9998.LockitButtonText);
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -118,8 +120,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -195,8 +197,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -296,8 +298,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -403,8 +405,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -507,8 +509,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -609,8 +611,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -703,15 +705,15 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.Off }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000),true),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: locksService.GetType().FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
new DeviceMock(),
|
||||
|
@ -729,7 +731,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("31", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR101", new List<string>(), null), // Was 31 before switching CopriCallsMemory(SampleSets.Set2, 1, ...)
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -745,11 +747,13 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.IsTrue(new List<string> { "Updating...", string.Empty }.Contains(bikesAtStation.StatusInfoText));
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(1, bikesAtStation.Count);
|
||||
Assert.AreEqual(3, bikesAtStation.Count); // Was 1 before switch.
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "52").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1003").StateText); // Was 52 before switch.
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1002").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1001").StateText);
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -774,8 +778,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.Off }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.Off }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://tinkwwp.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -842,19 +846,19 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: locksService.GetType().FullName,
|
||||
activeGeolocationService: locksService.GetType().FullName),
|
||||
new StoreMock(new TINK.Model.User.Account.Account(
|
||||
LoginSessionCopriInfo.JavaministerHardwareNr1.Mail,
|
||||
LoginSessionCopriInfo.JavaministerHardwareNr1.Mail,
|
||||
LoginSessionCopriInfo.JavaministerHardwareNr1.Pwd,
|
||||
"4da3044c8657a04ba60e2eaa753bc51a",
|
||||
new List<string> { "TINK" })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
"6103_112e96b36ba33de245943c5ffaf369cd_", // Was 4da3044c8657a04ba60e2eaa753bc51a before switching from data provider CopriCallsMemory(SampleSets.Set2, 1, ...)
|
||||
new List<string> { FilterHelper.FILTERTINKGENERAL })),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
new DeviceMock(),
|
||||
|
@ -872,7 +876,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("4", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 4 before switching from data provider CopriCallsMemory(SampleSets.Set2, 1, ...)
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -888,14 +892,14 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.IsTrue(new List<string> { "Updating...", string.Empty }.Contains(bikesAtStation.StatusInfoText));
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(4, bikesAtStation.Count);
|
||||
Assert.AreEqual(4, bikesAtStation.Count); // Count of bikes was 4 before switching from data provider CopriCallsMemory(SampleSets.Set2, 1, ...)
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "5").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "14").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "26").StateText);
|
||||
Assert.AreEqual("Code 2931, rented since 28. November 13:06.", bikesAtStation.FirstOrDefault(x => x.Id == "7").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText);
|
||||
Assert.AreEqual("Max. reservation time of 15 minutes expired.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1004").StateText);
|
||||
Assert.AreEqual("Rented since 06. November 18:57.", bikesAtStation.FirstOrDefault(x => x.Id == "FR1544").StateText); // Was 7
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsFalse(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -919,15 +923,15 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: locksService.GetType().FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1, sessionCookie)),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory001(sessionCookie)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
new DeviceMock(),
|
||||
|
@ -945,7 +949,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("4", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 4 before switching from data provider CopriCallsMemory(SampleSets.Set2, 1
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -961,13 +965,12 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.AreEqual("Offline.", bikesAtStation.StatusInfoText);
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(3, bikesAtStation.Count);
|
||||
Assert.AreEqual(2, bikesAtStation.Count); // Count of bikes was 3. There is no more bike with id 26.
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "5").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "14").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "26").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText); // Was id 5
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9998").StateText); // Was is 14
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -991,8 +994,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
|
@ -1009,7 +1012,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
TinkApp.MerchantId,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
sessionCookie: sessionCookie,
|
||||
cacheServer: new CopriCallsCacheMemory(sessionCookie: sessionCookie),
|
||||
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
|
||||
httpsServer: new ExceptionServer((msg) => new WebConnectFailureException(msg, new Exception("Source expection."))))),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
|
@ -1028,7 +1031,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("4", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 4 before switching from data provider CopriCallsCacheMemory()
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -1047,13 +1050,12 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.AreEqual("Connection interrupted, server unreachable.", bikesAtStation.StatusInfoText);
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(3, bikesAtStation.Count);
|
||||
Assert.AreEqual(2, bikesAtStation.Count); // Count of bikes was 3. There is no more bike with id 26.
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "5").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "14").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "26").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText); // Was id 5
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9998").StateText); // Was is 14
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
@ -1077,8 +1079,8 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var tinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new GroupFilterMapPage(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.Off } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { FilterHelper.FILTERTINKGENERAL, FilterState.On }, { FilterHelper.FILTERKONRAD, FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000),
|
||||
true),
|
||||
|
@ -1096,7 +1098,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
TinkApp.MerchantId,
|
||||
"TestTINKApp/3.0.127 AutomatedTestEnvirnoment/Default",
|
||||
sessionCookie: sessionCookie,
|
||||
cacheServer: new CopriCallsCacheMemory(sessionCookie: sessionCookie),
|
||||
cacheServer: new CopriCallsCacheMemory001(sessionCookie: sessionCookie),
|
||||
httpsServer: new ExceptionServer((msg) => new Exception(msg)))),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
locksService,
|
||||
|
@ -1115,7 +1117,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
new TINK.Model.Station.Station("4", new List<string>(), null),
|
||||
new TINK.Model.Station.Station("FR103", new List<string>(), null), // Was station id 4 before switching from data provider CopriCallsCacheMemory()
|
||||
() => tinkApp.GetIsConnected(),
|
||||
(isConnected) => tinkApp.GetConnector(isConnected),
|
||||
new GeolocationMock(),
|
||||
|
@ -1134,13 +1136,12 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
Assert.AreEqual("Connection interrupted.", bikesAtStation.StatusInfoText);
|
||||
|
||||
// Verify list of bikes
|
||||
Assert.AreEqual(3, bikesAtStation.Count);
|
||||
Assert.AreEqual(2, bikesAtStation.Count); // Count of bikes was 3. There is no more bike with id 26.
|
||||
Assert.IsTrue(bikesAtStation.IsIdle);
|
||||
Assert.IsTrue(bikesAtStation.IsBikesListVisible, "If there are any bikes, list must be visible.");
|
||||
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "5").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "14").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "26").StateText);
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9999").StateText); // Was id 5
|
||||
Assert.AreEqual("Available.", bikesAtStation.FirstOrDefault(x => x.Id == "FR9998").StateText); // Was id 14.
|
||||
|
||||
// Login hint/ no bikes frame
|
||||
Assert.IsTrue(bikesAtStation.IsLoginRequiredHintVisible);
|
||||
|
|
|
@ -4,9 +4,6 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using TestTINKLib.Mocks.Connector;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Repository.Exception;
|
||||
|
@ -27,6 +24,11 @@ using TINK.Model.Services.Geolocation;
|
|||
using NSubstitute.ExceptionExtensions;
|
||||
using TINK.Services;
|
||||
using TINK.Model.Device;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Repository;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.Permissions;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
||||
{
|
||||
|
@ -607,7 +609,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var myBikes = new MyBikesPageViewModel(
|
||||
tinkApp.ActiveUser,
|
||||
null, // Permissions,
|
||||
permissions, // Permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
() => tinkApp.GetIsConnected(),
|
||||
|
@ -682,7 +684,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var myBikes = new MyBikesPageViewModel(
|
||||
tinkApp.ActiveUser,
|
||||
null, // Permissions,
|
||||
permissions, // Permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
() => tinkApp.GetIsConnected(),
|
||||
|
@ -760,7 +762,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
|
||||
var myBikes = new MyBikesPageViewModel(
|
||||
tinkApp.ActiveUser,
|
||||
null, // Permissions,
|
||||
permissions, // Permissions,
|
||||
bluetooth,
|
||||
Device.iOS,
|
||||
() => tinkApp.GetIsConnected(),
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
using System;
|
||||
using TINK.Model;
|
||||
using TINK.Repository;
|
||||
using TestFramework.Model.Device;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.ConnectedOffline
|
||||
{
|
||||
using NSubstitute;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TestFramework.Services.Permissions;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Services;
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Model;
|
||||
using TestTINKLib.Model.User.Account;
|
||||
using TINK.Model.Connector;
|
||||
using TestTINKLib.Mocks.Device;
|
||||
using System;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using System.Collections.Generic;
|
||||
using TestTINKLib.Mocks.Services;
|
||||
using TINK.Repository;
|
||||
using TINK.ViewModel.Settings;
|
||||
using NSubstitute;
|
||||
using TINK.Services;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TestFramework.Services.Permissions;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.SelectStation
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>TestTINKLib</RootNamespace>
|
||||
<AssemblyName>TestTINKLib</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
|
@ -103,6 +103,7 @@
|
|||
<Compile Include="Fixtures\ObjectTests\ViewModel\CopriWebView\TestPasswordForgottonViewModel.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Info\TestInfoViewModel.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Map\TestMapPageFilter.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Map\TestMapPageViewModel.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Settings\TestFilterCollectionMutable.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\TestBikeAtStationInUseStateInfoProvider.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\TestBikeAtStationViewModel.cs" />
|
||||
|
@ -114,7 +115,6 @@
|
|||
<Compile Include="Fixtures\ObjectTests\ViewModel\TestMyBikesPageViewModel.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\TestViewModelHelper.cs" />
|
||||
<Compile Include="Fixtures\UseCases\ConnectedOffline\TestTinkApp.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\ViewModel\Map\TestMapPageViewModel.cs" />
|
||||
<Compile Include="Fixtures\UseCases\TestHelper.cs" />
|
||||
<Compile Include="LoginSessionCopriInfo.cs" />
|
||||
<None Include="Fixtures\ObjectTests\Bike\TestBikeSerializeJSON.cs" />
|
||||
|
@ -137,19 +137,11 @@
|
|||
<Compile Include="Fixtures\ObjectTests\State\TestStateRequestedInfoSerializeJSON.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\Station\TestStation.cs" />
|
||||
<Compile Include="Fixtures\UseCases\SelectStation\TestTinkApp.cs" />
|
||||
<Compile Include="Fixtures\UseCases\Startup\TestTinkApp.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\User\Account\TestValidator.cs" />
|
||||
<Compile Include="Fixtures\ObjectTests\User\TestUser.cs" />
|
||||
<Compile Include="Mocks\Bike\BikeCollectionMock.cs" />
|
||||
<Compile Include="Mocks\Connector\CopriCallsCacheMemory.cs" />
|
||||
<Compile Include="Mocks\Connector\ExceptionServer.cs" />
|
||||
<Compile Include="Mocks\DateTimeMocker.cs" />
|
||||
<Compile Include="Mocks\Device\DeviceMock.cs" />
|
||||
<Compile Include="Mocks\Device\SpecialFolderMock.cs" />
|
||||
<Compile Include="Mocks\Services\GeolocationMock.cs" />
|
||||
<Compile Include="Mocks\Services\LocksServiceMock.cs" />
|
||||
<Compile Include="Mocks\Services\PermissionsMock.cs" />
|
||||
<Compile Include="Mocks\User\Account\StoreMock.cs" />
|
||||
<Compile Include="TestHelper.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -204,6 +196,10 @@
|
|||
<Project>{3589ED1D-E734-429D-976F-1BEA4371DF14}</Project>
|
||||
<Name>LockItShared</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\TestFramework\TestFramework.csproj">
|
||||
<Project>{4884b154-2af0-4bca-aa53-1d82dfaf502b}</Project>
|
||||
<Name>TestFramework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\TINKLib\TINKLib.csproj">
|
||||
<Project>{b77f4222-0860-4494-a07c-ee8e09fa9983}</Project>
|
||||
<Name>TINKLib</Name>
|
||||
|
@ -211,6 +207,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Fixtures\ObjectTests\Connector\Updater\" />
|
||||
<Folder Include="Fixtures\UseCases\Startup\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
49
TestTINKLib/TestTINKLib.sln
Normal file
|
@ -0,0 +1,49 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31829.152
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestTINKLib", "TestTINKLib.csproj", "{730A31A5-6736-43CC-8F84-8FDA5093E283}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TINKLib", "..\TINKLib\TINKLib.csproj", "{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFramework", "..\TestFramework\TestFramework.csproj", "{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LockItBLE", "..\LockItBLE\LockItBLE.csproj", "{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LockItShared", "..\LockItShared\LockItShared.csproj", "{890B733E-1B82-4A5E-8374-C086FCD07AC3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{730A31A5-6736-43CC-8F84-8FDA5093E283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{730A31A5-6736-43CC-8F84-8FDA5093E283}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{730A31A5-6736-43CC-8F84-8FDA5093E283}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{730A31A5-6736-43CC-8F84-8FDA5093E283}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{45EBDF5B-8A6F-412A-A779-EBA1916B79A5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4884B154-2AF0-4BCA-AA53-1D82DFAF502B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E78188AF-130C-4AFA-ABE9-FF2C03921DEA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{890B733E-1B82-4A5E-8374-C086FCD07AC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{890B733E-1B82-4A5E-8374-C086FCD07AC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{890B733E-1B82-4A5E-8374-C086FCD07AC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{890B733E-1B82-4A5E-8374-C086FCD07AC3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F11B1C81-7325-4047-80E0-3D1A2B0A2C79}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,15 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XmlDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
<assemblyIdentity name="System.Xml.XmlDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
|
||||
|
|