diff --git a/test/SIL.XForge.Scripture.Tests/Services/SFProjectServiceTests.cs b/test/SIL.XForge.Scripture.Tests/Services/SFProjectServiceTests.cs index 4df2fd050ed..576183f172e 100644 --- a/test/SIL.XForge.Scripture.Tests/Services/SFProjectServiceTests.cs +++ b/test/SIL.XForge.Scripture.Tests/Services/SFProjectServiceTests.cs @@ -4133,15 +4133,18 @@ public void GetEventMetrics_InvalidProject() public async Task GetEventMetrics_ProjectAdmin() { var env = new TestEnvironment(); + IEnumerable expected = [new EventMetric()]; + env.EventMetricService.GetEventMetrics(Project01, pageIndex: 0, pageSize: 10).Returns(expected); // SUT - IEnumerable _ = await env.Service.GetEventMetricsAsync( + IEnumerable actual = await env.Service.GetEventMetricsAsync( User01, systemRoles: [SystemRole.User], Project01, pageIndex: 0, pageSize: 10 ); + Assert.AreEqual(expected, actual); env.EventMetricService.Received().GetEventMetrics(Project01, pageIndex: 0, pageSize: 10); } @@ -4149,15 +4152,18 @@ public async Task GetEventMetrics_ProjectAdmin() public async Task GetEventMetrics_ServalAdmin() { var env = new TestEnvironment(); + IEnumerable expected = [new EventMetric()]; + env.EventMetricService.GetEventMetrics(Project01, pageIndex: 0, pageSize: 10).Returns(expected); // SUT - IEnumerable _ = await env.Service.GetEventMetricsAsync( + IEnumerable actual = await env.Service.GetEventMetricsAsync( User06, systemRoles: [SystemRole.ServalAdmin], Project01, pageIndex: 0, pageSize: 10 ); + Assert.AreEqual(expected, actual); env.EventMetricService.Received().GetEventMetrics(Project01, pageIndex: 0, pageSize: 10); } @@ -4165,15 +4171,18 @@ public async Task GetEventMetrics_ServalAdmin() public async Task GetEventMetrics_SystemAdmin() { var env = new TestEnvironment(); + IEnumerable expected = [new EventMetric()]; + env.EventMetricService.GetEventMetrics(Project01, pageIndex: 0, pageSize: 10).Returns(expected); // SUT - IEnumerable _ = await env.Service.GetEventMetricsAsync( + IEnumerable actual = await env.Service.GetEventMetricsAsync( User06, systemRoles: [SystemRole.SystemAdmin], Project01, pageIndex: 0, pageSize: 10 ); + Assert.AreEqual(expected, actual); env.EventMetricService.Received().GetEventMetrics(Project01, pageIndex: 0, pageSize: 10); }