umogen-ng/test/Nyanlabs.Umogen.WebTests/GenerationTests.cs

41 lines
1.1 KiB
C#
Raw Normal View History

2023-11-17 22:46:30 +01:00
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("~");
}
}