33 using System ;
44 using System . Linq ;
55 using System . Threading . Tasks ;
6+ using Microsoft . Extensions . Logging . Abstractions ;
67 using NUnit . Framework ;
78 using ServiceControl . Monitoring ;
89 using ServiceControl . Operations ;
@@ -13,7 +14,7 @@ class MonitoringDataStoreTests : PersistenceTestBase
1314 [ Test ]
1415 public async Task Endpoints_load_from_dataStore_into_monitor ( )
1516 {
16- var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) ) ;
17+ var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) , NullLogger < EndpointInstanceMonitor > . Instance ) ;
1718 var endpoint1 = new EndpointDetails ( ) { HostId = Guid . NewGuid ( ) , Host = "Host1" , Name = "Name1" } ;
1819 await MonitoringDataStore . CreateIfNotExists ( endpoint1 ) ;
1920
@@ -26,7 +27,7 @@ public async Task Endpoints_load_from_dataStore_into_monitor()
2627 [ Test ]
2728 public async Task Endpoints_added_more_than_once_are_treated_as_same_endpoint ( )
2829 {
29- var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) ) ;
30+ var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) , NullLogger < EndpointInstanceMonitor > . Instance ) ;
3031 var endpoint1 = new EndpointDetails ( ) { HostId = Guid . NewGuid ( ) , Host = "Host1" , Name = "Name1" } ;
3132 await MonitoringDataStore . CreateIfNotExists ( endpoint1 ) ;
3233 await MonitoringDataStore . CreateIfNotExists ( endpoint1 ) ;
@@ -40,7 +41,7 @@ public async Task Endpoints_added_more_than_once_are_treated_as_same_endpoint()
4041 [ Test ]
4142 public async Task Updating_existing_endpoint_does_not_create_new_ones ( )
4243 {
43- var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) ) ;
44+ var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) , NullLogger < EndpointInstanceMonitor > . Instance ) ;
4445 var endpoint1 = new EndpointDetails ( ) { HostId = Guid . NewGuid ( ) , Host = "Host1" , Name = "Name1" } ;
4546 await MonitoringDataStore . CreateIfNotExists ( endpoint1 ) ;
4647 await MonitoringDataStore . CreateOrUpdate ( endpoint1 , endpointInstanceMonitoring ) ;
@@ -54,7 +55,7 @@ public async Task Updating_existing_endpoint_does_not_create_new_ones()
5455 [ Test ]
5556 public async Task Endpoint_is_created_if_doesnt_exist ( )
5657 {
57- var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) ) ;
58+ var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) , NullLogger < EndpointInstanceMonitor > . Instance ) ;
5859 var endpoint1 = new EndpointDetails ( ) { HostId = Guid . NewGuid ( ) , Host = "Host1" , Name = "Name1" } ;
5960 var endpoint2 = new EndpointDetails ( ) { HostId = Guid . NewGuid ( ) , Host = "Host2" , Name = "Name2" } ;
6061 await MonitoringDataStore . CreateIfNotExists ( endpoint1 ) ;
@@ -69,7 +70,7 @@ public async Task Endpoint_is_created_if_doesnt_exist()
6970 [ Test ]
7071 public async Task Endpoint_is_created_if_doesnt_exist_on_update ( )
7172 {
72- var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) ) ;
73+ var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) , NullLogger < EndpointInstanceMonitor > . Instance ) ;
7374 var endpoint1 = new EndpointDetails ( ) { HostId = Guid . NewGuid ( ) , Host = "Host1" , Name = "Name1" } ;
7475 var endpoint2 = new EndpointDetails ( ) { HostId = Guid . NewGuid ( ) , Host = "Host2" , Name = "Name2" } ;
7576 await MonitoringDataStore . CreateIfNotExists ( endpoint1 ) ;
@@ -84,7 +85,7 @@ public async Task Endpoint_is_created_if_doesnt_exist_on_update()
8485 [ Test ]
8586 public async Task Endpoint_is_updated ( )
8687 {
87- var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) ) ;
88+ var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) , NullLogger < EndpointInstanceMonitor > . Instance ) ;
8889 var endpoint1 = new EndpointDetails ( ) { HostId = Guid . NewGuid ( ) , Host = "Host1" , Name = "Name1" } ;
8990 await MonitoringDataStore . CreateIfNotExists ( endpoint1 ) ;
9091
@@ -93,7 +94,7 @@ public async Task Endpoint_is_updated()
9394 Assert . That ( endpointInstanceMonitoring . IsMonitored ( endpointInstanceMonitoring . GetEndpoints ( ) [ 0 ] . Id ) , Is . False ) ;
9495
9596 await MonitoringDataStore . UpdateEndpointMonitoring ( endpoint1 , true ) ;
96- endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) ) ;
97+ endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) , NullLogger < EndpointInstanceMonitor > . Instance ) ;
9798
9899 CompleteDatabaseOperation ( ) ;
99100 await MonitoringDataStore . WarmupMonitoringFromPersistence ( endpointInstanceMonitoring ) ;
@@ -104,7 +105,7 @@ public async Task Endpoint_is_updated()
104105 [ Test ]
105106 public async Task Endpoint_is_deleted ( )
106107 {
107- var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) ) ;
108+ var endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) , NullLogger < EndpointInstanceMonitor > . Instance ) ;
108109 var endpoint1 = new EndpointDetails ( ) { HostId = Guid . NewGuid ( ) , Host = "Host1" , Name = "Name1" } ;
109110 await MonitoringDataStore . CreateIfNotExists ( endpoint1 ) ;
110111
@@ -114,7 +115,7 @@ public async Task Endpoint_is_deleted()
114115
115116 await MonitoringDataStore . Delete ( endpointInstanceMonitoring . GetEndpoints ( ) [ 0 ] . Id ) ;
116117
117- endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) ) ;
118+ endpointInstanceMonitoring = new EndpointInstanceMonitoring ( new FakeDomainEvents ( ) , NullLogger < EndpointInstanceMonitor > . Instance ) ;
118119
119120 CompleteDatabaseOperation ( ) ;
120121 await MonitoringDataStore . WarmupMonitoringFromPersistence ( endpointInstanceMonitoring ) ;
0 commit comments