public void TestDbConnectionTraceForAfterBulkInsert() { // Prepare var trace = new Mock <ITrace>(); var repository = new TraceEntityRepository(trace.Object); var entities = new[] { new TraceEntity() { Id = 1, Name = "Name" } }; // Act repository.BulkInsert(entities); // Assert trace.Verify(t => t.AfterBulkInsert(It.IsAny <TraceLog>()), Times.Exactly(1)); }