コード例 #1
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void SecuritySymmetricEncryptionEventTest()
        {
            string eventName = "SecurityCryptoSymmetricEncryptionEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecuritySymmetricEncryptionEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #2
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void SecurityProfileLoadEventTest()
        {
            string eventName = "SecurityProfileLoadEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecurityProfileLoadEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #3
0
ファイル: WMIEventsFixture.cs プロジェクト: smillea1/NCS-V1-1
        public void SecurityCryptoHashFailureEventTest()
        {
            string           eventName = "SecurityCryptoHashCheckFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecurityCryptoHashFailureEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #4
0
ファイル: WMIEventsFixture.cs プロジェクト: smillea1/NCS-V1-1
        public void SecurityAuthenticationCheckEventTest()
        {
            string           eventName = "SecurityAuthenticationCheckEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecurityAuthenticationCheckEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #5
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void SecurityCryptoHashFailureEventTest()
        {
            string eventName = "SecurityCryptoHashCheckFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecurityCryptoHashFailureEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #6
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void SecurityAuthenticationCheckEventTest()
        {
            string eventName = "SecurityAuthenticationCheckEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecurityAuthenticationCheckEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #7
0
ファイル: WMIEventsFixture.cs プロジェクト: smillea1/NCS-V1-1
        public void SecurityAuthorizationFailedEventTest()
        {
            string           eventName = "SecurityAuthorizationFailedEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecurityAuthorizationFailedEvent);

            base.FireMessageToWMI(eventName, action, "Message = \"" + testMessage + ":" + "action" + "\"");
        }
コード例 #8
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void SecurityAuthorizationFailedEventTest()
        {
            string eventName = "SecurityAuthorizationFailedEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireSecurityAuthorizationFailedEvent);

            base.FireMessageToWMI(eventName, action, "Message = \"" + testMessage + ":" + "action" + "\"");
        }
コード例 #9
0
        public void LoggingServiceFailureEventTest()
        {
            string           eventName = "LoggingServiceFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireLoggingServiceFailureEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #10
0
        public void LoggingServiceFailureEventTest()
        {
            string eventName = "LoggingServiceFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireLoggingServiceFailureEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #11
0
ファイル: WMIEventsFixture.cs プロジェクト: smillea1/NCS-V1-1
        public void SecuritySymmetricDecryptionEventTest()
        {
            string           eventName = "SecurityCryptoSymmetricDecryptionEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecuritySymmetricDecryptionEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #12
0
ファイル: WMIEventsFixture.cs プロジェクト: smillea1/NCS-V1-1
        public void SecurityProfileLoadEventTest()
        {
            string           eventName = "SecurityProfileLoadEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireSecurityProfileLoadEvent);

            base.FireMessageToWMI(eventName, action, defaultExpected);
        }
コード例 #13
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void ConfigFailureTest()
        {
            string eventName = "ExceptionHandlingConfigFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireExceptionHandlingConfigFailureEvent);

            string expected = "Message = \"\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #14
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void CachingServiceInternalFailureEventTestWithException()
        {
            string eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceInternalFailureEventWithException);

            string expected = "ExceptionMessage = \"System.Exception: test exception\";\n\tExceptionStackTrace = NULL;\n\tMessage = \"test\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #15
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void CachingServiceCacheScavengedEventTest()
        {
            string eventName = "CachingServiceCacheScavengedEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceCacheScavengedEvent);

            string expected = "ConfiguredSizeLimit = \"1\";\n\tMessage = \"\";\n\tNumberOfItemRemoved = \"1\";\n\tScavengingRange = 1;\n\t";
            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #16
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void CachingServiceInternalFailureEventTest()
        {
            string eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceInternalFailureEvent);

            string expected = "Message = \"test\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #17
0
        public void DataServiceFailureEventTest()
        {
            string eventName = "DataServiceFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireDataServiceFailureEvent);

            string expected = "ExceptionMessage = \"System.Exception: test\";\n\tExceptionStackTrace = NULL;";
            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #18
0
ファイル: WMIEventsFixture.cs プロジェクト: bnantz/NCS-V1-1
        public void CachingServiceCacheFlushedEventTest()
        {
            string eventName = "CachingServiceCacheFlushedEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireCachingServiceCacheFlushedEvent);

            string expected = "Message = \"\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #19
0
        public void DataConnectionOpenedEventTest()
        {
            string eventName = "DataConnectionOpenedEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireDataConnectionOpenedEvent);

            string expected = "Message = \"Data Connection opened: test connection\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #20
0
        public void DataServiceConfigFailureEventTest()
        {
            string eventName = "DataServiceConfigFailureEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireDataServiceConfigFailureEvent);

            string expected = "ExceptionMessage = \"System.Exception: test\";\n\tExceptionStackTrace = NULL;\n\tFailedConfigurationFile = \"ConnectionSettings.config\";\n\tMessage = \"test\"";
            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #21
0
        public void DataConnectionFailedEventTest()
        {
            string           eventName = "DataConnectionFailedEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireDataConnectionFailedEvent);

            string expected = "Message = \"Data connection failed to open: test connection\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #22
0
        public void ConfigFailureTest()
        {
            string           eventName = "ExceptionHandlingConfigFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireExceptionHandlingConfigFailureEvent);

            string expected = "Message = \"\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #23
0
ファイル: WMIEventsFixture.cs プロジェクト: smillea1/NCS-V1-1
        public void CachingServiceCacheFlushedEventTest()
        {
            string           eventName = "CachingServiceCacheFlushedEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireCachingServiceCacheFlushedEvent);

            string expected = "Message = \"\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #24
0
ファイル: WMIEventsFixture.cs プロジェクト: smillea1/NCS-V1-1
        public void CachingServiceCacheScavengedEventTest()
        {
            string           eventName = "CachingServiceCacheScavengedEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireCachingServiceCacheScavengedEvent);

            string expected = "ConfiguredSizeLimit = \"1\";\n\tMessage = \"\";\n\tNumberOfItemRemoved = \"1\";\n\tScavengingRange = 1;\n\t";

            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #25
0
        public void DataTransactionRolledBackEventTest()
        {
            string           eventName = "DataTransactionRolledBackEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireDataTransactionRolledBackEvent);

            string expected = "Message = \"Connection: test connection\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #26
0
        public void DataServiceFailureEventTest()
        {
            string           eventName = "DataServiceFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireDataServiceFailureEvent);

            string expected = "ExceptionMessage = \"System.Exception: test\";\n\tExceptionStackTrace = NULL;";

            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #27
0
ファイル: WMIEventsFixture.cs プロジェクト: smillea1/NCS-V1-1
        public void CachingServiceInternalFailureEventTest()
        {
            string           eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireCachingServiceInternalFailureEvent);

            string expected = "Message = \"test\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #28
0
ファイル: WMIEventsFixture.cs プロジェクト: smillea1/NCS-V1-1
        public void CachingServiceInternalFailureEventTestWithException()
        {
            string           eventName = "CachingServiceInternalFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireCachingServiceInternalFailureEventWithException);

            string expected = "ExceptionMessage = \"System.Exception: test exception\";\n\tExceptionStackTrace = NULL;\n\tMessage = \"test\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #29
0
        public void DataServiceConfigFailureEventTest()
        {
            string           eventName = "DataServiceConfigFailureEvent";
            WmiEventDelegate action    =
                new WmiEventDelegate(FireDataServiceConfigFailureEvent);

            string expected = "ExceptionMessage = \"System.Exception: test\";\n\tExceptionStackTrace = NULL;\n\tFailedConfigurationFile = \"ConnectionSettings.config\";\n\tMessage = \"test\"";

            base.FireMessageToWMI(eventName, action, expected);
        }
コード例 #30
0
        public void FireMessageToWMI(string eventName, WmiEventDelegate action, string expected)
        {
            ManagementScope scope = new ManagementScope(@"\\." + WmiPath);
            scope.Options.EnablePrivileges = true;

            EventQuery eq = new EventQuery("SELECT * FROM " + eventName);

            using (ManagementEventWatcher watcher = new ManagementEventWatcher(scope, eq))
            {
                watcher.EventArrived += new EventArrivedEventHandler(WatcherEventArrived);
                watcher.Start();

                action();

                WaiUntilWMIEventArrives();
                watcher.Stop();
            }

            Assert.IsTrue(this.wmiLogged);
            Assert.IsTrue(this.wmiResult.IndexOf(expected) > -1);
        }
コード例 #31
0
        public void FireMessageToWMI(string eventName, WmiEventDelegate action, string expected)
        {
            ManagementScope scope = new ManagementScope(@"\\." + WmiPath);

            scope.Options.EnablePrivileges = true;

            EventQuery eq = new EventQuery("SELECT * FROM " + eventName);

            using (ManagementEventWatcher watcher = new ManagementEventWatcher(scope, eq))
            {
                watcher.EventArrived += new EventArrivedEventHandler(WatcherEventArrived);
                watcher.Start();

                action();

                WaiUntilWMIEventArrives();
                watcher.Stop();
            }

            Assert.IsTrue(this.wmiLogged);
            Assert.IsTrue(this.wmiResult.IndexOf(expected) > -1);
        }
コード例 #32
0
        public void DataTransactionRolledBackEventTest()
        {
            string eventName = "DataTransactionRolledBackEvent";
            WmiEventDelegate action =
                new WmiEventDelegate(FireDataTransactionRolledBackEvent);

            string expected = "Message = \"Connection: test connection\"";
            base.FireMessageToWMI(eventName, action, expected);
        }