10cd2986cf
Add nlog, PiscalQueueManager modified: Core.Tests/Remote/PiscalSshClientTests.cs modified: Core/DAL/DataService.cs modified: Core/Remote/IPiscalClient.cs modified: Core/Remote/PiscalSshClient.cs new file: Web/Attributes/ActionLogAttribute.cs modified: Web/Controllers/ControllerBase.cs modified: Web/Controllers/LeafInputController.cs modified: Web/Controllers/LeafOutputController.cs new file: Web/NLog.config new file: Web/NLog.xsd new file: Web/Services/PiscalQueueManager.cs modified: Web/Services/PiscalService.cs modified: Web/Startup.cs modified: Web/Web.csproj modified: Web/packages.config Ignore logs Organize piscal queue manager modified: Core/Entities/LeafInputFile.cs modified: Web/Controllers/LeafInputController.cs renamed: Web/Startup.cs -> Web/HangfireStartup.cs modified: Web/Services/PiscalQueueManager.cs modified: Web/Web.csproj cleanup usings in leafinputcontroller
50 lines
1.2 KiB
C#
50 lines
1.2 KiB
C#
using System;
|
|
using System.Configuration;
|
|
using System.Linq;
|
|
using LeafWeb.Core.Remote;
|
|
using LeafWeb.Core.Utility;
|
|
using NUnit.Framework;
|
|
|
|
namespace LeafWeb.Core.Tests.Remote
|
|
{
|
|
[TestFixture]
|
|
public class PiscalSshClientTests
|
|
{
|
|
private readonly PiscalLeafInputFile _testInput =
|
|
new PiscalLeafInputFile
|
|
{
|
|
Filename = "blah",
|
|
LeafInputId = 1,
|
|
Contents = "test".GetBytes(),
|
|
DirectoryName = "TestDirectory2"
|
|
};
|
|
|
|
private readonly string _piscalConnectionString =
|
|
ConfigurationManager.ConnectionStrings["PiscalServer"].ConnectionString;
|
|
|
|
[Test]
|
|
public void SubmitLeafInputFile()
|
|
{
|
|
var client = new PiscalSshClient(_piscalConnectionString);
|
|
client.RunLeafInputFile(_testInput);
|
|
}
|
|
|
|
[Test]
|
|
public void GetLeafInputStatus()
|
|
{
|
|
var client = new PiscalSshClient(_piscalConnectionString);
|
|
var leafInputStatus = client.GetLeafInputFileStatus(_testInput);
|
|
Console.WriteLine(leafInputStatus);
|
|
}
|
|
|
|
[Test]
|
|
public void RetrieveLeafOutput()
|
|
{
|
|
var client = new PiscalSshClient(_piscalConnectionString);
|
|
var result = client.RetrieveLeafOutput(_testInput).ToList();
|
|
Console.WriteLine(string.Join(", ", result.Select(o => o.Filename)));
|
|
//Console.WriteLine(result[0].Contents.GetString());
|
|
}
|
|
}
|
|
}
|