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 PiscalLeafInput _testInput = new PiscalLeafInput { LeafInputId = 1, DirectoryName = "TestDirectory2", PhotosyntheticType = "C4_photosynthesis_leafweb", InputFiles = new[] { new PiscalLeafInputFile { Filename = "blah", Contents = "test".GetBytes() } } }; private readonly string _piscalConnectionString = ConfigurationManager.ConnectionStrings["PiscalServer"].ConnectionString; [Test] public void SubmitLeafInputFile() { var client = new PiscalSshClient(_piscalConnectionString); client.RunLeafInput(_testInput); } [Test] public void GetLeafInputStatus() { var client = new PiscalSshClient(_piscalConnectionString); var leafInputStatus = client.GetLeafInputStatus(_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()); } } }