90 lines
3.1 KiB
C#
90 lines
3.1 KiB
C#
using System;
|
||
using System.Threading.Tasks;
|
||
using CtrEditor.HydraulicSimulator.Tests;
|
||
|
||
namespace CtrEditor.HydraulicSimulator.TSNet
|
||
{
|
||
/// <summary>
|
||
/// Programa de prueba para la integración TSNet
|
||
/// Se puede ejecutar independientemente para verificar la funcionalidad
|
||
/// </summary>
|
||
public class TSNetTestProgram
|
||
{
|
||
/// <summary>
|
||
/// Punto de entrada para las pruebas TSNet
|
||
/// </summary>
|
||
public static async Task<int> Main(string[] args)
|
||
{
|
||
try
|
||
{
|
||
Console.WriteLine("CtrEditor - TSNet Integration Test");
|
||
Console.WriteLine("==================================");
|
||
|
||
// Ejecutar todos los tests
|
||
var success = await TSNetIntegrationTest.RunAllTestsAsync();
|
||
|
||
if (success)
|
||
{
|
||
Console.WriteLine("\n🎉 All tests passed! TSNet integration is ready.");
|
||
|
||
// Test adicional de generación INP
|
||
Console.WriteLine("\nRunning additional INP generation test...");
|
||
var inpSuccess = await TSNetIntegrationTest.TestINPGeneration();
|
||
|
||
if (inpSuccess)
|
||
{
|
||
Console.WriteLine("\n🚀 TSNet integration fully verified!");
|
||
return 0; // Success
|
||
}
|
||
else
|
||
{
|
||
Console.WriteLine("\n⚠️ INP generation test failed");
|
||
return 1; // Partial failure
|
||
}
|
||
}
|
||
else
|
||
{
|
||
Console.WriteLine("\n❌ Integration tests failed. Check configuration.");
|
||
return 2; // Failure
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Console.WriteLine($"\n💥 Unexpected error: {ex.Message}");
|
||
Console.WriteLine($"Stack trace: {ex.StackTrace}");
|
||
return 3; // Error
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Método para ejecutar desde CtrEditor como prueba rápida
|
||
/// </summary>
|
||
public static async Task RunQuickTestAsync()
|
||
{
|
||
try
|
||
{
|
||
Console.WriteLine("TSNet Quick Test Starting...");
|
||
|
||
var result = await Main(new string[0]);
|
||
|
||
switch (result)
|
||
{
|
||
case 0:
|
||
Console.WriteLine("✅ TSNet integration working perfectly!");
|
||
break;
|
||
case 1:
|
||
Console.WriteLine("⚠️ TSNet integration partially working");
|
||
break;
|
||
default:
|
||
Console.WriteLine("❌ TSNet integration has issues");
|
||
break;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Console.WriteLine($"Quick test error: {ex.Message}");
|
||
}
|
||
}
|
||
}
|
||
}
|