Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoMataloniFiskaltrust committed Jan 3, 2025
1 parent 4c44e6a commit 4991cd8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ private static string GetCenteredText(string text, int length)
return text;
}

public static PrinterNonFiscal PerformUnspecifiedProtocolReceipt(ReceiptRequest request)
private static PrinterNonFiscal PerformUnspecifiedProtocolReceipt(ReceiptRequest request)
{
var content = new PrinterNonFiscal();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,35 @@ public void Test1()

_ = serviceCollection.BuildServiceProvider().GetRequiredService<IITSSCD>();
}
[Fact]
public void Test2()
{
var content = EpsonRTPrinterSCU.PerformUnspecifiedProtocolReceipt(ReceiptExamples.NonFiscal());
var data = fiskaltrust.Middleware.SCU.IT.EpsonRTPrinter.Utilities.SoapSerializer.Serialize(content);
var httpClient = new HttpClient
{
BaseAddress = new Uri("http://10.0.0.40"),
Timeout = TimeSpan.FromMilliseconds(15000)
};
var commandUrl = $"cgi-bin/fpmate.cgi?timeout=15000";
var response = httpClient.PostAsync(commandUrl, new StringContent(data, Encoding.UTF8, "application/xml")).GetAwaiter().GetResult();
//[Fact]
//public void Test2()
//{
// var content = EpsonRTPrinterSCU.PerformUnspecifiedProtocolReceipt(ReceiptExamples.NonFiscal());
// var data = fiskaltrust.Middleware.SCU.IT.EpsonRTPrinter.Utilities.SoapSerializer.Serialize(content);
// var httpClient = new HttpClient
// {
// BaseAddress = new Uri("http://10.0.0.40"),
// Timeout = TimeSpan.FromMilliseconds(15000)
// };
// var commandUrl = $"cgi-bin/fpmate.cgi?timeout=15000";
// var response = httpClient.PostAsync(commandUrl, new StringContent(data, Encoding.UTF8, "application/xml")).GetAwaiter().GetResult();

Console.WriteLine(response.Content.ReadAsStringAsync().GetAwaiter().GetResult());
}
[Fact]
public void Test3()
{
var content = EpsonRTPrinterSCU.PerformUnspecifiedProtocolReceipt(ReceiptExamples.NonFiscalReceipt());
var data = fiskaltrust.Middleware.SCU.IT.EpsonRTPrinter.Utilities.SoapSerializer.Serialize(content);
var httpClient = new HttpClient
{
BaseAddress = new Uri("http://10.0.0.40"),
Timeout = TimeSpan.FromMilliseconds(15000)
};
var commandUrl = $"cgi-bin/fpmate.cgi?timeout=15000";
var response = httpClient.PostAsync(commandUrl, new StringContent(data, Encoding.UTF8, "application/xml")).GetAwaiter().GetResult();
// Console.WriteLine(response.Content.ReadAsStringAsync().GetAwaiter().GetResult());
//}
//[Fact]
//public void Test3()
//{
// var content = EpsonRTPrinterSCU.PerformUnspecifiedProtocolReceipt(ReceiptExamples.NonFiscalReceipt());
// var data = fiskaltrust.Middleware.SCU.IT.EpsonRTPrinter.Utilities.SoapSerializer.Serialize(content);
// var httpClient = new HttpClient
// {
// BaseAddress = new Uri("http://10.0.0.40"),
// Timeout = TimeSpan.FromMilliseconds(15000)
// };
// var commandUrl = $"cgi-bin/fpmate.cgi?timeout=15000";
// var response = httpClient.PostAsync(commandUrl, new StringContent(data, Encoding.UTF8, "application/xml")).GetAwaiter().GetResult();

Console.WriteLine(response.Content.ReadAsStringAsync().GetAwaiter().GetResult());
}
// Console.WriteLine(response.Content.ReadAsStringAsync().GetAwaiter().GetResult());
//}
}
}

0 comments on commit 4991cd8

Please sign in to comment.