Skip to content

Commit

Permalink
[fix] analyzer warnings and XML comments
Browse files Browse the repository at this point in the history
  • Loading branch information
i4004 committed Jun 1, 2024
1 parent a369004 commit c510b26
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/TestClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

var result = client.ExecuteAsync(request).Result;

if (result.IsSuccessful != true)
if (!result.IsSuccessful)
throw new InvalidOperationException("Error sending file: " + result.Content);

Console.WriteLine("HTTP status: " + result.StatusCode);
Console.ReadLine();
Console.ReadLine();
9 changes: 4 additions & 5 deletions src/TestServer/Controllers/Api/v1/TestInController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Simplify.Web;
using Simplify.Web.Attributes;
Expand All @@ -14,17 +13,17 @@ public class TestInController : Controller2<MultipartViewModel>
{
public async Task<ControllerResponse> Invoke()
{
var file = Model.Files.FirstOrDefault() ?? throw new ArgumentException("No files in model");
var file = Model.Files[0] ?? throw new ArgumentException("No files in model");
using var stream = new StreamReader(file.Data);
var fileData = await stream.ReadToEndAsync();

Trace.WriteLine($"Files count: '{Model.Files.Count}'");
Trace.TraceInformation($"Files count: '{Model.Files.Count}'");
Console.WriteLine($"Files count: '{Model.Files.Count}'");

Trace.WriteLine($"File name: '{file.FileName}'");
Trace.TraceInformation($"File name: '{file.FileName}'");
Console.WriteLine($"File name: '{file.FileName}'");

Trace.WriteLine($"File content: '{fileData}'");
Trace.TraceInformation($"File content: '{fileData}'");
Console.WriteLine($"File content: '{fileData}'");

// Assert
Expand Down
21 changes: 7 additions & 14 deletions src/TestServer/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
{
"iisSettings":
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress":
{
"iisExpress": {
"applicationUrl": "http://localhost:5000",
"sslPort": 0
}
},
"profiles":
{
"IIS Express":
{
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"environmentVariables":
{
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"TesterApp":
{
"TesterApp": {
"commandName": "Project",
"environmentVariables":
{
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"launchBrowser": true,
Expand Down

0 comments on commit c510b26

Please sign in to comment.