41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
using Nyanlabs.Umogen.Core;
|
||
|
using Nyanlabs.Umogen.Core.Models;
|
||
|
|
||
|
namespace Nyanlabs.Umogen.WebTests;
|
||
|
|
||
|
public class GenerationTests
|
||
|
{
|
||
|
private Person ModelEmployer => new("Kotek", "Miauczyński", "CBS4327563", "04281308999", new DateTime(2004, 08, 13));
|
||
|
|
||
|
private Person ModelEmployee => new("Miau", "Kotczyński", "CBS69696969", "76011694336", new DateTime(1976, 1, 16));
|
||
|
|
||
|
[Fact]
|
||
|
public async Task Meow4Me()
|
||
|
{
|
||
|
// Given
|
||
|
var rootDir = Environment.CurrentDirectory.Replace("test/Nyanlabs.Umogen.WebTests/bin/Debug/net8.0", "");
|
||
|
|
||
|
UmoEngine eng = new(Path.Combine(rootDir, Core.Umogen.DEFAULT_API_KEY_FILE));
|
||
|
|
||
|
// When
|
||
|
UmoDocument doc = new(UmoDoctype.CONTR_EMPLOYMENT, ModelEmployer, ModelEmployee);
|
||
|
|
||
|
UmoProcess proc = new(eng);
|
||
|
var enu = proc.Ask(doc.NLSerialize());
|
||
|
|
||
|
await foreach (var str in enu)
|
||
|
{
|
||
|
Console.Write(str);
|
||
|
File.AppendAllText("/tmp/doc.md", str);
|
||
|
}
|
||
|
|
||
|
Console.WriteLine("~");
|
||
|
|
||
|
}
|
||
|
}
|