File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/Serilog.Ui.RavenDbProvider
tests/Serilog.Ui.Web.Tests/Endpoints Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ SortDirection sortBy
106
106
} ;
107
107
}
108
108
109
+ /// <inheritdoc/>
109
110
public async Task < DashboardModel > FetchDashboardAsync ( CancellationToken cancellationToken = default )
110
111
{
111
112
var dashboard = new DashboardModel ( ) ;
Original file line number Diff line number Diff line change @@ -118,13 +118,17 @@ public async Task It_serializes_an_error_on_exception()
118
118
[ Fact ]
119
119
public async Task It_returns_dashboard_data ( )
120
120
{
121
- // Arrange / Act
121
+ // Arrange - Setup proper query string
122
+ _testContext . Request . QueryString = new QueryString ( "" ) ;
123
+
124
+ // Act
122
125
var result = await HappyPath < DashboardModel > ( _sut . GetDashboardAsync ) ;
123
126
124
- // Assert - Let's see what we actually get first
127
+ // Assert - Match FakeProvider dashboard data
125
128
result . Should ( ) . NotBeNull ( ) ;
126
- result . TotalLogs . Should ( ) . Be ( 100 ) ; // Should match FakeProvider
129
+ result . TotalLogs . Should ( ) . Be ( 100 ) ;
127
130
result . LogsByLevel . Should ( ) . ContainKey ( "Information" ) ;
131
+ result . LogsByLevel [ "Information" ] . Should ( ) . Be ( 100 ) ;
128
132
result . TodayLogs . Should ( ) . Be ( 10 ) ;
129
133
result . TodayErrorLogs . Should ( ) . Be ( 1 ) ;
130
134
}
You can’t perform that action at this time.
0 commit comments