build cli
This commit is contained in:
@ -1,8 +1,12 @@
|
||||
using isnd.tests;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
using Yavsc.Abstract.Manage;
|
||||
using Yavsc.Interface;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace yavscTests
|
||||
{
|
||||
@ -25,12 +29,18 @@ namespace yavscTests
|
||||
[Fact]
|
||||
public void SendEMailSynchrone()
|
||||
{
|
||||
|
||||
AssertAsync.CompletesIn(2, () =>
|
||||
AssertAsync.CompletesIn(2, () =>
|
||||
{
|
||||
using IServiceScope scope = _serverFixture.Services.CreateScope();
|
||||
ITrueEmailSender mailSender = scope.ServiceProvider.GetRequiredService<ITrueEmailSender>();
|
||||
|
||||
output.WriteLine("SendEMailSynchrone ...");
|
||||
_serverFixture.MailSender.SendEmailAsync
|
||||
(_serverFixture.SiteSettings.Owner.EMail, $"monthly email", "test boby monthly email").Wait();
|
||||
mailSender.SendEmailAsync
|
||||
(
|
||||
_serverFixture.SiteSettings.Owner.Name,
|
||||
_serverFixture.SiteSettings.Owner.EMail,
|
||||
$"monthly email",
|
||||
"test boby monthly email").Wait();
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -1,66 +0,0 @@
|
||||
using System;
|
||||
using Xunit;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace yavscTests
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Since node isn't any requirement by here,
|
||||
/// It may regress
|
||||
/// </summary>
|
||||
[Trait("regression", "allways")]
|
||||
public class NodeTests
|
||||
{
|
||||
void TestNodeJsForAnsitohtml ()
|
||||
{
|
||||
var procStart = new ProcessStartInfo("node", "node_modules/ansi-to-html/bin/ansi-to-html")
|
||||
{
|
||||
UseShellExecute = false,
|
||||
RedirectStandardInput = true,
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true
|
||||
};
|
||||
var proc = Process.Start(procStart);
|
||||
proc.StandardInput.WriteLine("\x001b[30mblack\x1b[37mwhite");
|
||||
proc.StandardInput.Close();
|
||||
while (!proc.StandardOutput.EndOfStream)
|
||||
{
|
||||
Console.Write(proc.StandardOutput.ReadToEnd());
|
||||
}
|
||||
}
|
||||
|
||||
void AnsiToHtml()
|
||||
{
|
||||
var procStart = new ProcessStartInfo("ls", "-l --color=always")
|
||||
{
|
||||
UseShellExecute = false,
|
||||
RedirectStandardInput = false,
|
||||
RedirectStandardOutput = true
|
||||
};
|
||||
var proc = Process.Start(procStart);
|
||||
var encoded = GetStream(proc.StandardOutput);
|
||||
var reader = new StreamReader(encoded);
|
||||
var txt = reader.ReadToEnd();
|
||||
|
||||
Console.WriteLine(txt);
|
||||
}
|
||||
|
||||
public static Stream GetStream(StreamReader reader)
|
||||
{
|
||||
var procStart = new ProcessStartInfo("node", "node_modules/ansi-to-html/bin/ansi-to-html");
|
||||
procStart.UseShellExecute = false;
|
||||
procStart.RedirectStandardInput = true;
|
||||
procStart.RedirectStandardOutput = true;
|
||||
procStart.RedirectStandardError = true;
|
||||
var mem = new MemoryStream();
|
||||
StreamWriter writer = new StreamWriter(mem);
|
||||
var proc = Process.Start(procStart);
|
||||
var text = reader.ReadToEnd();
|
||||
proc.StandardInput.WriteLine(text);
|
||||
proc.StandardInput.Close();
|
||||
return proc.StandardOutput.BaseStream;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user