Skip to content

Commit

Permalink
Solution wide code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornnorgaard committed Jun 19, 2024
1 parent e2df7f7 commit 5919771
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Ast.Platform/Configurations/TelemetryConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ internal static void AddPlatformTelemetry(this IServiceCollection services, ICon
internal static void UsePlatformTelemetry(this IApplicationBuilder app, IConfiguration configuration)
{
}
}
}
6 changes: 3 additions & 3 deletions src/Ast.Platform/HostExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using OpenTelemetry.Logs;
using Serilog;

namespace Ast.Platform;

Expand All @@ -15,7 +14,8 @@ public static IHostBuilder UsePlatformLogger(this IHostBuilder builder)
if (string.IsNullOrWhiteSpace(collectorEndpoint))
{
collectorEndpoint = "http://localhost:18889";
Console.WriteLine($"Environment variable {key} is not set. Using default OpenTelemetry collector endpoint: {collectorEndpoint}");
Console.WriteLine(
$"Environment variable {key} is not set. Using default OpenTelemetry collector endpoint: {collectorEndpoint}");
}

return builder.ConfigureLogging(loggingBuilder =>
Expand All @@ -39,4 +39,4 @@ public static IHostBuilder UsePlatformLogger(this IHostBuilder builder)
);
});
}
}
}
2 changes: 1 addition & 1 deletion src/Ast.Platform/PipelineBehaviors/LoggingPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ public async Task<TResponse> Handle(TRequest req, RequestHandlerDelegate<TRespon

return result;
}
}
}
2 changes: 1 addition & 1 deletion src/Ast.Todos.Tests/Assertions/FluentAssertionExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public static void ShouldBeSuccess(this HttpResponseMessage actualValue)
var msg = actualValue.Content.ReadAsStringAsync().Result;
throw new AssertionFailedException(msg);
}
}
}
2 changes: 1 addition & 1 deletion src/Ast.Todos.Tests/Integration/Controllers/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ public class TodoDto
public bool IsCompleted { get; set; }
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ public async Task ShouldCreateTodo_WhenTodoIsValid()
content.CreatedTodo.Id.MustBeValidGuid();
content.CreatedTodo.IsCompleted.Should().BeFalse();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public async Task ShouldDeleteTodo()
found.Should().BeEquivalentTo(todo);
found.Id.ToString().MustBeValidGuid();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ public async Task ShouldReturnPagedListOfTodos()
todo.IsCompleted.Should().BeFalse();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public async Task ShouldThrow_WhenTodoIsInvalid()
// Assert
result.CreatedTodo.Id.Should().NotBeEmpty();
}
}
}
6 changes: 3 additions & 3 deletions src/Ast.Todos/Features/Todos/GetTodos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public Handler(TodoContext todoContext)

public async Task<Result> Handle(Command request, CancellationToken ct)
{
ActivityCurrent.SetTag("PageNumber", request.PageNumber);
ActivityCurrent.SetTag("PageSize", request.PageSize);
ActivityCurrent.SetTag("page_number", request.PageNumber);
ActivityCurrent.SetTag("page_size", request.PageSize);

var todos = await _todoContext.Todos.AsNoTracking()
.SortBy(TodoSortExpressions.Get(request.SortProperty), request.SortOrder)
Expand All @@ -63,4 +63,4 @@ public async Task<Result> Handle(Command request, CancellationToken ct)
return result;
}
}
}
}

0 comments on commit 5919771

Please sign in to comment.