Пример #1
0
        public void TestDbConnectionTraceForAfterBulkInsertAsync()
        {
            // Prepare
            var trace      = new Mock <ITrace>();
            var repository = new TraceEntityRepository(trace.Object);
            var entities   = new[] { new TraceEntity()
                                     {
                                         Id = 1, Name = "Name"
                                     } };

            // Act
            repository.BulkInsertAsync(entities).Wait();

            // Assert
            trace.Verify(t => t.AfterBulkInsert(It.IsAny <TraceLog>()), Times.Exactly(1));
        }