public void DatabaseTelemetryInterceptor_CommandCreated()
        {
            var result = new DatabaseTelemetryInterceptor(
                new TelemetryClient(new TelemetryConfiguration()))
                         .CommandCreated(null, null);

            Assert.IsNull(result);
        }
        public void DatabaseTelemetryInterceptor_GetSqlName_Null()
        {
            var result =
                DatabaseTelemetryInterceptor.GetSqlName(
                    new MySqlCommand("t", null));

            Assert.AreEqual("SQLDatabase", result);
        }
        public void DatabaseTelemetryInterceptor_CommandCreating()
        {
            var result = new DatabaseTelemetryInterceptor(
                new TelemetryClient(new TelemetryConfiguration()))
                         .CommandCreating(null, new InterceptionResult <DbCommand>());

            Assert.IsNotNull(result);
        }
        public void DatabaseTelemetryInterceptor_DataReaderDisposing_test()
        {
            var result = new DatabaseTelemetryInterceptor(
                new TelemetryClient(new TelemetryConfiguration()))
                         .DataReaderDisposing(new MySqlCommand("test"), null, InterceptionResult.Suppress());

            Assert.IsNotNull(result);
        }
        public void DatabaseTelemetryInterceptor_NonQueryExecutedAsync()
        {
            var result = new DatabaseTelemetryInterceptor(
                new TelemetryClient(new TelemetryConfiguration()))
                         .NonQueryExecutedAsync(null, null, 1);

            Assert.IsNotNull(result);
        }
        public void DatabaseTelemetryInterceptor_ReaderExecutedAsync()
        {
            var result = new DatabaseTelemetryInterceptor(
                new TelemetryClient(new TelemetryConfiguration()))
                         .ReaderExecutedAsync(null, null, new DataTableReader(new DataTable()));

            Assert.IsNotNull(result);
        }
        public void DatabaseTelemetryInterceptor_GetSqlName_Ok()
        {
            var result =
                DatabaseTelemetryInterceptor.GetSqlName(
                    new MySqlCommand("t", new MySqlConnection("Server=test.nl;database=test;uid=test;pwd=test;")));

            Assert.AreEqual("test.nl | test", result);
        }
        public void DatabaseTelemetryInterceptor_ScalarExecuted()
        {
            var result = new DatabaseTelemetryInterceptor(
                new TelemetryClient(new TelemetryConfiguration()))
                         .ScalarExecuted(null, null, null);

            Assert.IsNull(result);
        }
        public void DatabaseTelemetryInterceptor_ReaderExecutingAsync()
        {
            InterceptionResult <DbDataReader> eventData = InterceptionResult <DbDataReader> .SuppressWithResult(new DataTableReader(new DataTable()));

            var result = new DatabaseTelemetryInterceptor(
                new TelemetryClient(new TelemetryConfiguration()))
                         .ReaderExecutingAsync(null, null, eventData);

            Assert.IsNotNull(result);
        }
        public void DatabaseTelemetryInterceptor_NonQueryExecuting()
        {
            InterceptionResult <int> eventData = InterceptionResult <int> .SuppressWithResult(1);

            var result = new DatabaseTelemetryInterceptor(
                new TelemetryClient(new TelemetryConfiguration()))
                         .NonQueryExecuting(null, null, eventData);

            Assert.IsNotNull(result);
        }
        public void DatabaseTelemetryInterceptor_ScalarExecuting()
        {
            InterceptionResult <object> eventData = InterceptionResult <object> .SuppressWithResult(new DataTableReader(new DataTable()));

            var result = new DatabaseTelemetryInterceptor(
                new TelemetryClient(new TelemetryConfiguration()))
                         .ScalarExecuting(null, null, eventData);

            Assert.IsNotNull(result);
        }