добавлены не загруженные тесты

This commit is contained in:
2025-02-05 15:08:38 +03:00
parent 2c2f554302
commit ed4e97e40f
5 changed files with 94 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Example.Shared\Example.Shared.csproj" />
</ItemGroup>
</Project>
+27
View File
@@ -0,0 +1,27 @@
// See https://aka.ms/new-console-template for more information
using System.Net;
using System.Text;
using Example.Shared;
using mROA.Codegen;
using mROA.Implementation;
using mROA.Implementation.Bootstrap;
var mixer = new FullMixBuilder();
mixer.Modules.Add(new FrontendContextRepository());
mixer.Modules.Add(new JsonFrontendSerialisationModule());
mixer.Modules.Add(new StreamBasedInteractionModule());
mixer.Modules.Add(new NetworkFrontendBridge(new IPEndPoint(IPAddress.Loopback, 4567)));
mixer.Build();
var context = mixer.GetModule<FrontendContextRepository>();
var factory = context.GetSingleObject(typeof(IPrinterFactory)) as IPrinterFactory;
var printer = factory.Create("Test");
var name = printer.Value.GetName();
Console.WriteLine("Printer name : {0}", name);
var page = printer.Value.Print("Test Page");
var data = page.Value.GetData();
Console.WriteLine("Data : {0}", Encoding.UTF8.GetString(data));