Add new demo program
This commit is contained in:
@ -58,7 +58,7 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<StartupObject>Hcs.ClientDemo.Program</StartupObject>
|
<StartupObject>Hcs.TestApp.Program</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
@ -75,6 +75,7 @@
|
|||||||
<Compile Include="ClientDemo\NsiDemo.cs" />
|
<Compile Include="ClientDemo\NsiDemo.cs" />
|
||||||
<Compile Include="ClientDemo\Program.cs" />
|
<Compile Include="ClientDemo\Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="TestApp\Program.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
|
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
|
||||||
|
|||||||
57
Hcs.TestApp/TestApp/Program.cs
Normal file
57
Hcs.TestApp/TestApp/Program.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Hcs.Client;
|
||||||
|
using Hcs.Client.Logger;
|
||||||
|
using Hcs.Client.MessageCapturer;
|
||||||
|
using Hcs.TestApp.Scenario;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Hcs.TestApp
|
||||||
|
{
|
||||||
|
internal class Program
|
||||||
|
{
|
||||||
|
[STAThread]
|
||||||
|
public static void Main(string[] _)
|
||||||
|
{
|
||||||
|
System.Threading.Thread.CurrentThread.CurrentUICulture =
|
||||||
|
new System.Globalization.CultureInfo("en-US");
|
||||||
|
|
||||||
|
var logger = new ConsoleLogger();
|
||||||
|
var client = new UniClient
|
||||||
|
{
|
||||||
|
OrgPPAGUID = "ccd7fa02-a2bf-428a-984b-faef69ae0eb2",
|
||||||
|
ExecutorGUID = "ccd7fa02-a2bf-428a-984b-faef69ae0eb2",
|
||||||
|
UseTunnel = false,
|
||||||
|
IsPPAK = false,
|
||||||
|
Role = OrganizationRole.RSO,
|
||||||
|
Logger = logger,
|
||||||
|
MessageCapturer = new FileMessageCapturer(null, logger)
|
||||||
|
};
|
||||||
|
|
||||||
|
var cert = client.FindCertificate(x => x.SerialNumber == "0636D2330032B3C38A4A26D765C787C248");
|
||||||
|
if (cert == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("Certificate " + cert.Subject + " found");
|
||||||
|
|
||||||
|
client.SetSigningCertificate(cert);
|
||||||
|
|
||||||
|
var nsiScenario = new NsiScenario(client);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//nsiScenario.ExportDataProviderNsiItem1();
|
||||||
|
//nsiScenario.ExportDataProviderNsiItem51();
|
||||||
|
//nsiScenario.ExportDataProviderNsiItem59();
|
||||||
|
//nsiScenario.ExportDataProviderNsiItem219();
|
||||||
|
//nsiScenario.ExportDataProviderNsiItem272();
|
||||||
|
//nsiScenario.ExportDataProviderNsiItem302();
|
||||||
|
//nsiScenario.ExportDataProviderNsiItem337();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
Console.ReadKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
54
Hcs.TestApp/TestApp/Scenario/NsiScenario.cs
Normal file
54
Hcs.TestApp/TestApp/Scenario/NsiScenario.cs
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
using Hcs.Client;
|
||||||
|
using Hcs.Service.Async.Nsi;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Hcs.TestApp.Scenario
|
||||||
|
{
|
||||||
|
internal class NsiScenario(UniClient client)
|
||||||
|
{
|
||||||
|
private readonly UniClient client = client;
|
||||||
|
|
||||||
|
internal void ExportDataProviderNsiItem1()
|
||||||
|
{
|
||||||
|
var result = client.Nsi.ExportDataProviderNsiItem(exportDataProviderNsiItemRequestRegistryNumber.Item1).Result;
|
||||||
|
Console.WriteLine("Scenario execution " + (result.Count() > 0 ? "succeeded" : "failed"));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void ExportDataProviderNsiItem51()
|
||||||
|
{
|
||||||
|
var result = client.Nsi.ExportDataProviderNsiItem(exportDataProviderNsiItemRequestRegistryNumber.Item51).Result;
|
||||||
|
Console.WriteLine("Scenario execution " + (result.Count() > 0 ? "succeeded" : "failed"));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void ExportDataProviderNsiItem59()
|
||||||
|
{
|
||||||
|
var result = client.Nsi.ExportDataProviderNsiItem(exportDataProviderNsiItemRequestRegistryNumber.Item59).Result;
|
||||||
|
Console.WriteLine("Scenario execution " + (result.Count() > 0 ? "succeeded" : "failed"));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void ExportDataProviderNsiItem219()
|
||||||
|
{
|
||||||
|
var result = client.Nsi.ExportDataProviderNsiItem(exportDataProviderNsiItemRequestRegistryNumber.Item219).Result;
|
||||||
|
Console.WriteLine("Scenario execution " + (result.Count() > 0 ? "succeeded" : "failed"));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void ExportDataProviderNsiItem272()
|
||||||
|
{
|
||||||
|
var result = client.Nsi.ExportDataProviderNsiItem(exportDataProviderNsiItemRequestRegistryNumber.Item272).Result;
|
||||||
|
Console.WriteLine("Scenario execution " + (result.Count() > 0 ? "succeeded" : "failed"));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void ExportDataProviderNsiItem302()
|
||||||
|
{
|
||||||
|
var result = client.Nsi.ExportDataProviderNsiItem(exportDataProviderNsiItemRequestRegistryNumber.Item302).Result;
|
||||||
|
Console.WriteLine("Scenario execution " + (result.Count() > 0 ? "succeeded" : "failed"));
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void ExportDataProviderNsiItem337()
|
||||||
|
{
|
||||||
|
var result = client.Nsi.ExportDataProviderNsiItem(exportDataProviderNsiItemRequestRegistryNumber.Item337).Result;
|
||||||
|
Console.WriteLine("Scenario execution " + (result.Count() > 0 ? "succeeded" : "failed"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user