mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 23:01:52 +01:00
Fixed: List Machine and Nuget Packages
This commit is contained in:
parent
d7c362773b
commit
9bee54f312
@ -54,9 +54,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Prism.DryIoc.Forms">
|
||||
<Version>8.0.0.1909</Version>
|
||||
<Version>7.2.0.1422</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1351" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
2523
Borepin/Borepin.Android/Resources/Resource.designer.cs
generated
2523
Borepin/Borepin.Android/Resources/Resource.designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@ -75,11 +75,11 @@
|
||||
<Reference Include="Prism, Version=8.0.0.1909, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.Core.8.0.0.1909\lib\net47\Prism.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism.DryIoc.Forms, Version=8.0.0.1909, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.DryIoc.Forms.8.0.0.1909\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
|
||||
<Reference Include="Prism.DryIoc.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.DryIoc.Forms.7.2.0.1422\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism.Forms, Version=8.0.0.1909, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.Forms.8.0.0.1909\lib\netstandard2.0\Prism.Forms.dll</HintPath>
|
||||
<Reference Include="Prism.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.Forms.7.2.0.1422\lib\netstandard2.0\Prism.Forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@ -90,19 +90,19 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="webkit-sharp, Version=1.1.15.0, Culture=neutral, PublicKeyToken=eaa1d335d2e19745, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.8.0.1687\lib\net45\webkit-sharp.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.7.0.1351\lib\net45\webkit-sharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform.GTK, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.8.0.1687\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.Platform.GTK.4.7.0.1351\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -124,10 +124,10 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets')" />
|
||||
</Project>
|
@ -3,8 +3,8 @@
|
||||
<package id="DryIoc.dll" version="4.5.1" targetFramework="net48" />
|
||||
<package id="OpenTK" version="3.2" targetFramework="net48" />
|
||||
<package id="Prism.Core" version="8.0.0.1909" targetFramework="net472" />
|
||||
<package id="Prism.DryIoc.Forms" version="8.0.0.1909" targetFramework="net48" />
|
||||
<package id="Prism.Forms" version="8.0.0.1909" targetFramework="net48" />
|
||||
<package id="Xamarin.Forms" version="4.8.0.1687" targetFramework="net48" />
|
||||
<package id="Xamarin.Forms.Platform.GTK" version="4.8.0.1687" targetFramework="net48" />
|
||||
<package id="Prism.DryIoc.Forms" version="7.2.0.1422" targetFramework="net48" />
|
||||
<package id="Prism.Forms" version="7.2.0.1422" targetFramework="net48" />
|
||||
<package id="Xamarin.Forms" version="4.7.0.1351" targetFramework="net48" />
|
||||
<package id="Xamarin.Forms.Platform.GTK" version="4.7.0.1351" targetFramework="net48" />
|
||||
</packages>
|
@ -172,9 +172,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Prism.DryIoc.Forms">
|
||||
<Version>8.0.0.1909</Version>
|
||||
<Version>7.2.0.1422</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1351" />
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.11" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
|
||||
</ItemGroup>
|
||||
|
@ -175,7 +175,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Prism.DryIoc.Forms">
|
||||
<Version>8.0.0.1909</Version>
|
||||
<Version>7.2.0.1422</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
|
||||
<PackageReference Include="Xamarin.Forms">
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@ -65,22 +65,22 @@
|
||||
<Reference Include="Prism, Version=8.0.0.1909, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.Core.8.0.0.1909\lib\netstandard2.0\Prism.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism.DryIoc.Forms, Version=8.0.0.1909, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.DryIoc.Forms.8.0.0.1909\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
|
||||
<Reference Include="Prism.DryIoc.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.DryIoc.Forms.7.2.0.1422\lib\netstandard2.0\Prism.DryIoc.Forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism.Forms, Version=8.0.0.1909, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.Forms.8.0.0.1909\lib\netstandard2.0\Prism.Forms.dll</HintPath>
|
||||
<Reference Include="Prism.Forms, Version=7.2.0.1422, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Prism.Forms.7.2.0.1422\lib\netstandard2.0\Prism.Forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\Xamarin.Mac\Xamarin.Forms.Core.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\Xamarin.Mac\Xamarin.Forms.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\Xamarin.Mac\Xamarin.Forms.Platform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.8.0.1687\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
<HintPath>..\..\packages\Xamarin.Forms.4.7.0.1351\lib\Xamarin.Mac\Xamarin.Forms.Xaml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xamarin.Mac" />
|
||||
</ItemGroup>
|
||||
@ -127,10 +127,10 @@
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.8.0.1687\build\Xamarin.Forms.targets')" />
|
||||
<Import Project="..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.7.0.1351\build\Xamarin.Forms.targets')" />
|
||||
</Project>
|
@ -2,8 +2,8 @@
|
||||
<packages>
|
||||
<package id="DryIoc.dll" version="4.5.1" targetFramework="xamarinmac20" />
|
||||
<package id="Prism.Core" version="8.0.0.1909" targetFramework="xamarinmac20" />
|
||||
<package id="Prism.DryIoc.Forms" version="8.0.0.1909" targetFramework="xamarinmac20" />
|
||||
<package id="Prism.Forms" version="8.0.0.1909" targetFramework="xamarinmac20" />
|
||||
<package id="Prism.DryIoc.Forms" version="7.2.0.1422" targetFramework="xamarinmac20" />
|
||||
<package id="Prism.Forms" version="7.2.0.1422" targetFramework="xamarinmac20" />
|
||||
<package id="System.Reflection.Emit.Lightweight" version="4.7.0" targetFramework="xamarinmac20" />
|
||||
<package id="Xamarin.Forms" version="4.8.0.1687" targetFramework="xamarinmac20" />
|
||||
<package id="Xamarin.Forms" version="4.7.0.1351" targetFramework="xamarinmac20" />
|
||||
</packages>
|
@ -21,8 +21,8 @@
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="Prism.DryIoc.Forms" Version="8.0.0.1909" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1687" />
|
||||
<PackageReference Include="Prism.DryIoc.Forms" Version="7.2.0.1422" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1351" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
|
||||
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
|
||||
<PackageReference Include="Xamarin.Forms.EntryAutoComplete" Version="1.0.0" />
|
||||
|
@ -10,7 +10,6 @@ namespace FabAccessAPI {
|
||||
#region private variables
|
||||
private TcpRpcClient? _rpcClient = null;
|
||||
private IBootstrap? _bootstrapCap = null;
|
||||
private AuthUser? _authUser = null;
|
||||
private Auth? _auth = null;
|
||||
private Machines? _machines = null;
|
||||
#endregion
|
||||
|
@ -31,8 +31,16 @@ namespace FabAccessAPI {
|
||||
/// List of all machines that BFFH knows about the user has been granted at least read access on
|
||||
/// </summary>
|
||||
/// <returns>ReadOnlyList of available Machines</returns>
|
||||
public async Task<IReadOnlyList<Machine>?> ListMachines() {
|
||||
return (await _machinesCap.ListMachines().ConfigureAwait(false)).Select(x => new Machine(x)) as IReadOnlyList<Machine>;
|
||||
public async Task<IReadOnlyList<Machine>?> ListMachines()
|
||||
{
|
||||
IReadOnlyList<Schema.Machine>? machineList = await _machinesCap.ListMachines().ConfigureAwait(false);
|
||||
List<Machine> machineList_new = new List<Machine>();
|
||||
foreach(Schema.Machine machine in machineList)
|
||||
{
|
||||
machineList_new.Add(new Machine(machine));
|
||||
}
|
||||
|
||||
return machineList_new;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1,84 +0,0 @@
|
||||
using Capnp.Rpc;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
|
||||
namespace FabAccessAPI_Test
|
||||
{
|
||||
public class ConnectionTest
|
||||
{
|
||||
[Test, Repeat(10)]
|
||||
public void IPv4()
|
||||
{
|
||||
UriBuilder builder = new UriBuilder();
|
||||
builder.Host = "127.0.0.1";
|
||||
builder.Port = 59661;
|
||||
|
||||
Uri uri = builder.Uri;
|
||||
|
||||
TcpRpcClient rpcClient = new TcpRpcClient();
|
||||
|
||||
rpcClient.Connect(uri.Host, uri.Port);
|
||||
|
||||
while (rpcClient.State == ConnectionState.Initializing);
|
||||
|
||||
FabAccessAPI.Connection connection = new FabAccessAPI.Connection(rpcClient);
|
||||
|
||||
Assert.AreEqual(ConnectionState.Active, connection.RpcClient.State);
|
||||
|
||||
rpcClient.Dispose();
|
||||
Assert.AreEqual(ConnectionState.Down, connection.RpcClient.State);
|
||||
}
|
||||
|
||||
[Test, Repeat(10)]
|
||||
public void IPv6()
|
||||
{
|
||||
UriBuilder builder = new UriBuilder();
|
||||
builder.Host = "[::1]";
|
||||
builder.Port = 59661;
|
||||
|
||||
Uri uri = builder.Uri;
|
||||
|
||||
TcpRpcClient rpcClient = new TcpRpcClient();
|
||||
|
||||
rpcClient.Connect(uri.Host, uri.Port);
|
||||
|
||||
while (rpcClient.State == ConnectionState.Initializing) ;
|
||||
|
||||
FabAccessAPI.Connection connection = new FabAccessAPI.Connection(rpcClient);
|
||||
|
||||
Assert.AreEqual(ConnectionState.Active, connection.RpcClient.State);
|
||||
|
||||
rpcClient.Dispose();
|
||||
Assert.AreEqual(ConnectionState.Down, connection.RpcClient.State);
|
||||
}
|
||||
|
||||
[Test, Repeat(10)]
|
||||
public void DoubleConnect()
|
||||
{
|
||||
TcpRpcClient rpcClient = new TcpRpcClient();
|
||||
|
||||
rpcClient.Connect("127.0.0.1", 59661);
|
||||
|
||||
while (rpcClient.State == ConnectionState.Initializing) ;
|
||||
|
||||
FabAccessAPI.Connection connection = new FabAccessAPI.Connection(rpcClient);
|
||||
|
||||
Assert.AreEqual(ConnectionState.Active, connection.RpcClient.State);
|
||||
|
||||
rpcClient.Dispose();
|
||||
Assert.AreEqual(ConnectionState.Down, connection.RpcClient.State);
|
||||
|
||||
rpcClient = new TcpRpcClient();
|
||||
|
||||
rpcClient.Connect("127.0.0.1", 59661);
|
||||
|
||||
connection = new FabAccessAPI.Connection(rpcClient);
|
||||
while (rpcClient.State == ConnectionState.Initializing) ;
|
||||
|
||||
Assert.AreEqual(ConnectionState.Active, connection.RpcClient.State);
|
||||
|
||||
rpcClient.Dispose();
|
||||
Assert.AreEqual(ConnectionState.Down, connection.RpcClient.State);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
@ -31,7 +30,7 @@ namespace FabAccessAPI_Test {
|
||||
|
||||
[SetUp]
|
||||
public void Setup() {
|
||||
var rpcClient = new TcpRpcClient();
|
||||
TcpRpcClient rpcClient = new TcpRpcClient();
|
||||
rpcClient.Connect("[::1]", 59661);
|
||||
_connection = new Connection(rpcClient);
|
||||
}
|
||||
@ -53,15 +52,43 @@ namespace FabAccessAPI_Test {
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Machines() {
|
||||
public async Task GetMInfo() {
|
||||
await _connection.Auth("PLAIN", new Dictionary<string, object>{{"Username", "Testuser"}, {"Password", "secret"}});
|
||||
var machines = await _connection.AccessMachines();
|
||||
|
||||
var testmachine = await machines.GetMachine("Testmachine");
|
||||
Machines machines = await _connection.AccessMachines();
|
||||
|
||||
Machine testmachine = await machines.GetMachine("Testmachine");
|
||||
Assert.NotNull(testmachine);
|
||||
var minfo = await testmachine.GetMInfo();
|
||||
|
||||
FabAccessAPI.Schema.Machine.MInfo minfo = await testmachine.GetMInfo();
|
||||
Assert.NotNull(minfo);
|
||||
_Log.Info($"Name: {minfo.Name}, Description: {minfo.Description}, State: {minfo.State}");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task ListMachines()
|
||||
{
|
||||
await _connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", "Testuser" }, { "Password", "secret" } });
|
||||
Machines machines = await _connection.AccessMachines();
|
||||
|
||||
IReadOnlyList<Machine> machineList = await machines.ListMachines();
|
||||
Assert.NotNull(machineList);
|
||||
Assert.AreNotEqual(0, machineList.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task UseMachine()
|
||||
{
|
||||
await _connection.Auth("PLAIN", new Dictionary<string, object> { { "Username", "Testuser" }, { "Password", "secret" } });
|
||||
Machines machines = await _connection.AccessMachines();
|
||||
|
||||
Machine testmachine = await machines.GetMachine("Testmachine");
|
||||
Assert.NotNull(testmachine);
|
||||
|
||||
await testmachine.Use();
|
||||
|
||||
FabAccessAPI.Schema.Machine.MInfo minfo = await testmachine.GetMInfo();
|
||||
Assert.NotNull(minfo);
|
||||
Assert.AreEqual(FabAccessAPI.Schema.State.inUse, minfo.State);
|
||||
}
|
||||
}
|
||||
}
|
@ -9,8 +9,8 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.0" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -8,6 +8,6 @@
|
||||
<PackageReference Include="log4net" Version="2.0.12" />
|
||||
<PackageReference Include="PCSC" Version="5.0.0" />
|
||||
<PackageReference Include="PCSC.Iso7816" Version="5.0.0" />
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.8.8" />
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.8.9" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
Loading…
x
Reference in New Issue
Block a user