Exemplo n.º 1
0
        public void InvalidSqlInstanceProductMode()
        {
            string          settingsFileName = string.Format("{0}\\Settings.xml", m_TempPath);
            SettingsManager settingsManager  = new SettingsManager(settingsFileName);

            settingsManager.ServiceGuid = s_TestServiceGuid;
            StackHashContextSettings settings = settingsManager.CreateNewContextSettings();

            settings.ErrorIndexSettings.Type      = ErrorIndexType.SqlExpress;
            settings.ErrorIndexSettings.Name      = "TestIndex";
            settings.ErrorIndexSettings.Folder    = m_TempPath;
            settings.SqlSettings.ConnectionString = "Data Source=(local)\\INVALIDEXPRESS;Integrated Security=True";

            settings.IsActive = true; // Force an attempt to activate.

            string         licenseFileName = string.Format("{0}\\License.bin", m_TempPath);
            LicenseManager licenseManager  = new LicenseManager(licenseFileName, s_TestServiceGuid);

            licenseManager.SetLicense(s_LicenseId);

            ScriptManager scriptManager = new ScriptManager(m_ScriptPath);
            IDebugger     debugger      = new Windbg();


            ControllerContext context = new ControllerContext(settings, scriptManager, debugger, settingsManager, false, StackHashTestData.Default, licenseManager);

            Assert.AreEqual(false, context.IsActive);
            Assert.AreEqual(StackHashServiceErrorCode.SqlConnectionError, context.Status.CurrentError);
            Assert.AreNotEqual(null, context.Status.LastContextException);
            context.Dispose();
        }
Exemplo n.º 2
0
        public void ActivateOk()
        {
            string          settingsFileName = string.Format("{0}\\ServiceSettings.xml", m_TempPath);
            SettingsManager settingsManager  = new SettingsManager(settingsFileName);

            settingsManager.ServiceGuid = s_TestServiceGuid;
            StackHashContextSettings settings = settingsManager.CreateNewContextSettings();

            settings.ErrorIndexSettings.Folder = m_TempPath;
            settings.ErrorIndexSettings.Name   = "TestIndex";
            settings.ErrorIndexSettings.Type   = ErrorIndexType.Xml;


            string         licenseFileName = string.Format("{0}\\License.bin", m_TempPath);
            LicenseManager licenseManager  = new LicenseManager(licenseFileName, s_TestServiceGuid);

            licenseManager.SetLicense(s_LicenseId);

            ScriptManager scriptManager = new ScriptManager(m_ScriptPath);
            IDebugger     debugger      = new Windbg();

            ControllerContext context = new ControllerContext(settings, scriptManager, debugger, settingsManager, true, StackHashTestData.Default, licenseManager);

            Assert.AreEqual(false, context.IsActive);
            Assert.AreEqual(null, context.WinQualSyncTimerTask);

            // Hook up to receive admin events.
            context.AdminReports += new EventHandler <AdminReportEventArgs>(this.OnAdminReport);

            StackHashClientData clientData = new StackHashClientData(Guid.NewGuid(), "Mark", 24);

            context.Activate(clientData, false);

            // Wait for the activation event.
            m_ActivationAdminEvent.WaitOne(3000);

            Assert.AreEqual(1, m_AllReports.Count);
            Assert.AreEqual(clientData.ApplicationGuid, m_AllReports[0].Report.ClientData.ApplicationGuid);
            Assert.AreEqual(clientData.ClientId, m_AllReports[0].Report.ClientData.ClientId);
            Assert.AreEqual(clientData.ClientName, m_AllReports[0].Report.ClientData.ClientName);
            Assert.AreEqual(clientData.ClientRequestId, m_AllReports[0].Report.ClientData.ClientRequestId);

            Assert.AreEqual(0, m_AllReports[0].Report.ContextId);
            Assert.AreNotEqual(null, m_AllReports[0].Report.Description);
            Assert.AreNotEqual(null, m_AllReports[0].Report.Message);
            Assert.AreEqual(StackHashAdminOperation.ContextStateChanged, m_AllReports[0].Report.Operation);
            Assert.AreEqual(StackHashServiceErrorCode.NoError, m_AllReports[0].Report.ServiceErrorCode);
            Assert.AreEqual(null, m_AllReports[0].Report.LastException);
            Assert.AreEqual(null, m_AllReports[0].Report.LastException);
            Assert.AreEqual(StackHashAdminOperation.ContextStateChanged, m_AllReports[0].Report.Operation);

            StackHashContextStateAdminReport contextChanged = m_AllReports[0].Report as StackHashContextStateAdminReport;

            Assert.AreEqual(true, contextChanged.IsActivationAttempt);
            Assert.AreEqual(true, contextChanged.IsActive);

            Assert.AreEqual(true, context.IsActive);
            Assert.AreNotEqual(null, context.WinQualSyncTimerTask);
            context.Dispose();
        }
Exemplo n.º 3
0
        public void WinQualSyncRunsOnTimer()
        {
            string settingsFileName = string.Format("{0}\\ServiceSettings.xml", m_TempPath);
            SettingsManager settingsManager = new SettingsManager(settingsFileName);
            settingsManager.ServiceGuid = s_TestServiceGuid;

            StackHashContextSettings settings = settingsManager.CreateNewContextSettings();
            settings.ErrorIndexSettings.Folder = m_TempPath;
            settings.ErrorIndexSettings.Name = "TestIndex";
            settings.ErrorIndexSettings.Type = ErrorIndexType.Xml;

            ScriptManager scriptManager = new ScriptManager(m_ScriptPath);
            IDebugger debugger = new Windbg();

            string licenseFileName = string.Format("{0}\\License.bin", m_TempPath);
            LicenseManager licenseManager = new LicenseManager(licenseFileName, s_TestServiceGuid);
            licenseManager.SetLicense(s_LicenseId);


            // Make sure the correct winqual login details are used.
            settings.WinQualSettings.UserName = "******";
            settings.WinQualSettings.Password = "******";
            settings.WinQualSyncSchedule = new ScheduleCollection();
            Schedule schedule = new Schedule();
            schedule.DaysOfWeek = Schedule.EveryDay;
            schedule.Period = SchedulePeriod.Daily;

            DateTime now = DateTime.Now; // Must use local time.
            DateTime syncTime = now.AddSeconds(5);

            schedule.Time = new ScheduleTime(syncTime.Hour, syncTime.Minute, syncTime.Second);
            settings.WinQualSyncSchedule.Add(schedule);


            ControllerContext context = new ControllerContext(settings, scriptManager, debugger, settingsManager, true, StackHashTestData.Default, licenseManager);
            context.AdminReports += new EventHandler<AdminReportEventArgs>(this.OnAdminReport);

            try
            {
                context.Activate();

                Assert.AreEqual(true, m_WinQualSyncEvent.WaitOne(8000));
                Assert.AreEqual(true, m_AnalyzeEvent.WaitOne(5000));

                Assert.AreEqual(1, m_SyncCount);
                Assert.AreEqual(1, m_AnalyzeCount);

                context.Deactivate();
                Assert.AreEqual(false, context.IsActive);
                Assert.AreEqual(null, context.WinQualSyncTimerTask);
            }
            finally
            {
                context.AdminReports -= new EventHandler<AdminReportEventArgs>(this.OnAdminReport);
                context.Dispose();
            }
        }
Exemplo n.º 4
0
        public void RunAllAutoScripts()
        {
            String dumpFileName = m_TempPath + "Cucku.exe.mdmp";

            // First make a copy of the test cab file.
            File.Copy(TestSettings.TestDataFolder + @"Dumps\Cucku.exe.mdmp",
                      dumpFileName, true);
            FileAttributes attributes = File.GetAttributes(dumpFileName);

            File.SetAttributes(dumpFileName, attributes & ~FileAttributes.ReadOnly);

            ScriptManager scriptManager = new ScriptManager(m_TempPath);

            // Now execute the script.
            StackHashDebug.Windbg winDbg = new Windbg();

            try
            {
                Collection <AutoScriptBase> autoScripts = scriptManager.AutoScripts;

                foreach (AutoScriptBase autoScript in autoScripts)
                {
                    // Generate the script settings structure in memory.
                    StackHashScriptSettings scriptSettings = autoScript.GenerateScript();

                    // Those settings are now used to create a WinDbg script file (wds). This file has a command
                    // to create a log file (the resultsFileName).
                    String resultsFileName = String.Format("{0}.log", Path.Combine(m_TempPath, autoScript.ScriptName));
                    String scriptFileName  = String.Format("{0}.wds", Path.Combine(m_TempPath, autoScript.ScriptName));
                    String symPath         = null;
                    String exePath         = null;
                    String srcPath         = null;
                    scriptSettings.GenerateScriptFile(scriptFileName, resultsFileName, ref symPath, ref exePath, ref srcPath);

                    // Run the wds file through the debugger to produce the results.log file.
                    winDbg.RunScript(m_DebuggerSettings, false, scriptFileName, dumpFileName, m_TempPath, symPath, exePath, srcPath);

                    // Load the results.log file.
                    StackHashScriptResult scriptResults = new StackHashScriptResult(resultsFileName);

                    // Analyse the results.
                    StackHashDumpAnalysis analysis = new StackHashDumpAnalysis();
                    analysis = autoScript.AnalyzeScriptResults(analysis, scriptResults);
                }
            }
            finally
            {
                scriptManager.RemoveAutoScripts();
            }
        }
Exemplo n.º 5
0
        public void RunAutoScript()
        {
            String dumpFileName    = m_TempPath + "Cucku.exe.mdmp";
            String scriptFileName  = m_TempPath + "AutoScript.wds";
            String resultsFileName = m_TempPath + "AutoScript.log";

            // First make a copy of the test cab file.
            File.Copy(TestSettings.TestDataFolder + @"Dumps\Cucku.exe.mdmp",
                      dumpFileName, true);
            FileAttributes attributes = File.GetAttributes(dumpFileName);

            File.SetAttributes(dumpFileName, attributes & ~FileAttributes.ReadOnly);

            AutoScript autoScript = new AutoScript(m_TempPath);
            StackHashScriptSettings scriptSettings = autoScript.GenerateScript();
            String symPath = null;
            String exePath = null;
            String srcPath = null;

            scriptSettings.GenerateScriptFile(scriptFileName, resultsFileName, ref symPath, ref exePath, ref srcPath);

            Assert.AreEqual(null, symPath);
            Assert.AreEqual(null, exePath);
            Assert.AreEqual(null, srcPath);

            // Now execute the script.
            StackHashDebug.Windbg winDbg = new Windbg();
            winDbg.RunScript(m_DebuggerSettings, false, scriptFileName, dumpFileName, m_TempPath, symPath, exePath, srcPath);

            // Load the results file.
            StackHashScriptResult scriptResults = new StackHashScriptResult(resultsFileName);

            // Analyse the results.
            StackHashDumpAnalysis analysis = new StackHashDumpAnalysis();

            analysis = autoScript.AnalyzeScriptResults(analysis, scriptResults);

            Assert.AreEqual("not available", analysis.SystemUpTime);
            Assert.AreEqual("0 days 0:02:20.000", analysis.ProcessUpTime);

            Assert.AreEqual("2.0.50727.3603", analysis.DotNetVersion);
        }
Exemplo n.º 6
0
        public void CheckWinQualSyncParametersInvalidWinQualSchedule()
        {
            try
            {
                string settingsFileName = string.Format("{0}\\ServiceSettings.xml", m_TempPath);
                SettingsManager settingsManager = new SettingsManager(settingsFileName);
                settingsManager.ServiceGuid = s_TestServiceGuid;
                StackHashContextSettings settings = settingsManager.CreateNewContextSettings();
                settings.ErrorIndexSettings.Folder = m_TempPath;
                settings.ErrorIndexSettings.Name = "TestIndex";
                settings.ErrorIndexSettings.Type = ErrorIndexType.Xml;

                ScriptManager scriptManager = new ScriptManager(m_TempPath);
                IDebugger debugger = new Windbg();

                // Make sure the correct winqual login details are used.
                settings.WinQualSettings.UserName = "******";
                settings.WinQualSettings.Password = "******";
                settings.WinQualSyncSchedule = new ScheduleCollection();
                Schedule schedule = new Schedule();
                // schedule.DaysOfWeek = Schedule.EveryDay; - No Daily specified.
                schedule.Period = SchedulePeriod.Daily;

                DateTime now = DateTime.Now; // Must use local time.
                DateTime syncTime = now.AddSeconds(5);

                schedule.Time = new ScheduleTime(syncTime.Hour, syncTime.Minute, syncTime.Second);
                settings.WinQualSyncSchedule.Add(schedule);

                string licenseFileName = string.Format("{0}\\License.bin", m_TempPath);
                LicenseManager licenseManager = new LicenseManager(licenseFileName, s_TestServiceGuid);
                licenseManager.SetLicense(s_LicenseId);

                // Should fail with a param exception.
                // TODO: should the test setting here be false??
                ControllerContext context = new ControllerContext(settings, scriptManager, debugger, settingsManager, true, null, licenseManager);
            }
            catch (StackHashException ex)
            {
                Assert.AreEqual(StackHashServiceErrorCode.ScheduleFormatError, ex.ServiceErrorCode);
            }
        }
Exemplo n.º 7
0
        public void ConstructorInactivePlaintextPassword()
        {
            string          settingsFileName = string.Format("{0}\\Settings.xml", m_TempPath);
            SettingsManager settingsManager  = new SettingsManager(settingsFileName);

            settingsManager.ServiceGuid = s_TestServiceGuid;
            StackHashContextSettings settings = settingsManager.CreateNewContextSettings();

            settings.WinQualSettings.Password = "******";
            settingsManager.SetContextSettings(settings, false);

            string         licenseFileName = string.Format("{0}\\License.bin", m_TempPath);
            LicenseManager licenseManager  = new LicenseManager(licenseFileName, s_TestServiceGuid);

            licenseManager.SetLicense(s_LicenseId);

            ScriptManager scriptManager = new ScriptManager(m_ScriptPath);
            IDebugger     debugger      = new Windbg();

            ControllerContext context = new ControllerContext(settings, scriptManager, debugger, settingsManager, true, StackHashTestData.Default, licenseManager);

            Assert.AreEqual(false, context.IsActive);
            Assert.AreEqual(null, context.WinQualSyncTimerTask);

            String password = settings.WinQualSettings.Password;

            Assert.AreEqual(password, settingsManager.CurrentSettings.ContextCollection[0].WinQualSettings.Password);

            // Reload to make sure the settings file was updated too.
            settingsManager             = new SettingsManager(settingsFileName);
            settingsManager.ServiceGuid = s_TestServiceGuid;
            Assert.AreEqual(password, settingsManager.CurrentSettings.ContextCollection[0].WinQualSettings.Password);

            String [] lines = File.ReadAllLines(settingsFileName);

            foreach (String line in lines)
            {
                Assert.AreEqual(false, line.Contains(settings.WinQualSettings.Password));
            }
            context.Dispose();
        }
Exemplo n.º 8
0
        public void RunSimpleScript()
        {
            // Create a test script.
            String testScriptName = "ScriptName";
            String testCommand    = @"r";
            String testComment    = @"Just a demo";

            StackHashScript script = new StackHashScript();

            script.Add(new StackHashScriptLine(testCommand, testComment));
            StackHashScriptSettings scriptSettings = new StackHashScriptSettings(testScriptName, script);

            String scriptFileName  = m_TempPath + @"\GeneratedScript.wds";
            String resultsFileName = m_TempPath + @"\Results.log";
            String symPath         = null;
            String exePath         = null;
            String srcPath         = null;

            scriptSettings.GenerateScriptFile(scriptFileName, resultsFileName, ref symPath, ref exePath, ref srcPath);

            Assert.AreEqual(null, symPath);
            Assert.AreEqual(null, exePath);
            Assert.AreEqual(null, srcPath);

            // Run the script with the debugger.
            Windbg debugger     = new Windbg();
            String dumpFileName = TestSettings.TestDataFolder + @"Dumps\Cucku.exe.mdmp";

            StackHashDebuggerSettings debuggerSettings = new StackHashDebuggerSettings();

            debuggerSettings.DebuggerPathAndFileName = StackHashDebuggerSettings.Default32BitDebuggerPathAndFileName;
            debuggerSettings.SymbolPath = StackHashSearchPath.DefaultSymbolPath;
            debugger.RunScript(debuggerSettings, true, scriptFileName, dumpFileName, resultsFileName, symPath, exePath, srcPath);

            Assert.AreEqual(true, File.Exists(resultsFileName));
            String[] allResults = File.ReadAllLines(resultsFileName, Encoding.Unicode);

            Assert.AreEqual(true, allResults.Length > 0);
        }
Exemplo n.º 9
0
        public void ConstructorInactive()
        {
            string          settingsFileName = string.Format("{0}\\Settings.xml", m_TempPath);
            SettingsManager settingsManager  = new SettingsManager(settingsFileName);

            settingsManager.ServiceGuid = s_TestServiceGuid;
            StackHashContextSettings settings = settingsManager.CreateNewContextSettings();

            string         licenseFileName = string.Format("{0}\\License.bin", m_TempPath);
            LicenseManager licenseManager  = new LicenseManager(licenseFileName, s_TestServiceGuid);

            licenseManager.SetLicense(s_LicenseId);

            ScriptManager scriptManager = new ScriptManager(m_ScriptPath);
            IDebugger     debugger      = new Windbg();

            ControllerContext context = new ControllerContext(settings, scriptManager, debugger, settingsManager, true, StackHashTestData.Default, licenseManager);

            Assert.AreEqual(false, context.IsActive);
            Assert.AreEqual(null, context.WinQualSyncTimerTask);
            context.Dispose();
        }
Exemplo n.º 10
0
        public void simpleScriptNCommands(int numCommands, bool addComment)
        {
            // Create a test script.
            String testScriptName = "ScriptName";
            String testCommand    = @"r";

            String testComment = null;

            if (addComment)
            {
                testComment = @"Just a demo";
            }

            StackHashScript script = new StackHashScript();

            for (int i = 0; i < numCommands; i++)
            {
                script.Add(new StackHashScriptLine(testCommand, testComment + i.ToString()));
            }
            StackHashScriptSettings scriptSettings = new StackHashScriptSettings(testScriptName, script);

            String scriptFileName  = m_TempPath + @"\GeneratedScript.wds";
            String resultsFileName = m_TempPath + @"\Results.log";

            String symPath = null;
            String exePath = null;
            String srcPath = null;

            scriptSettings.GenerateScriptFile(scriptFileName, resultsFileName, ref symPath, ref exePath, ref srcPath);

            Assert.AreEqual(null, symPath);
            Assert.AreEqual(null, exePath);
            Assert.AreEqual(null, srcPath);

            // Run the script with the debugger.
            Windbg debugger = new Windbg();

            String dumpFileName = TestSettings.TestDataFolder + @"Dumps\Cucku.exe.mdmp";

            DateTime startTime = DateTime.Now.ToUniversalTime();

            StackHashDebuggerSettings debuggerSettings = new StackHashDebuggerSettings();

            debuggerSettings.DebuggerPathAndFileName = StackHashDebuggerSettings.Default32BitDebuggerPathAndFileName;
            debuggerSettings.SymbolPath = StackHashSearchPath.DefaultSymbolPath;
            debuggerSettings.BinaryPath = StackHashSearchPath.DefaultBinaryPath;
            debugger.RunScript(debuggerSettings, true, scriptFileName, dumpFileName, resultsFileName, symPath, exePath, srcPath);

            DateTime endTime = DateTime.Now.ToUniversalTime();

            Assert.AreEqual(true, File.Exists(resultsFileName));

            // Now load in the test results.
            StackHashScriptResult result = new StackHashScriptResult(resultsFileName);


            Assert.AreEqual(scriptSettings.Name, result.Name);
            Assert.AreEqual(scriptSettings.LastModifiedDate.Date, result.LastModifiedDate.Date);
            Assert.AreEqual(scriptSettings.LastModifiedDate.Hour, result.LastModifiedDate.Hour);
            Assert.AreEqual(scriptSettings.LastModifiedDate.Minute, result.LastModifiedDate.Minute);
            Assert.AreEqual(scriptSettings.LastModifiedDate.Second, result.LastModifiedDate.Second);


            // Recorded time is only accurate to the second.
            long ticksInASecond = 10000000;

            startTime = new DateTime((startTime.Ticks / ticksInASecond) * ticksInASecond, DateTimeKind.Utc);
            endTime   = new DateTime((endTime.Ticks / ticksInASecond) * ticksInASecond, DateTimeKind.Utc);

            bool isGreaterEqual  = result.RunDate >= startTime;
            bool isLessThanEqual = result.RunDate <= endTime;

            long ticks1 = result.RunDate.Ticks;
            long ticks2 = startTime.Ticks;
            long ticks3 = endTime.Ticks;

            Assert.AreEqual(true, (result.RunDate >= startTime) && (result.RunDate <= endTime));

            Assert.AreEqual(numCommands, scriptSettings.Script.Count);

            for (int i = 0; i < numCommands; i++)
            {
                Assert.AreEqual(scriptSettings.Script[i].Command, result.ScriptResults[i].ScriptLine.Command);
                Assert.AreEqual(scriptSettings.Script[i].Comment, result.ScriptResults[i].ScriptLine.Comment);

                Assert.AreEqual(5, result.ScriptResults[i].ScriptLineOutput.Count);
                Assert.AreEqual(true, result.ScriptResults[i].ScriptLineOutput[0].StartsWith("eax="));
                Assert.AreEqual(true, result.ScriptResults[i].ScriptLineOutput[1].StartsWith("eip="));
                Assert.AreEqual(true, result.ScriptResults[i].ScriptLineOutput[2].StartsWith("cs="));
            }
        }
Exemplo n.º 11
0
        public void ChangeParamsWhileActive()
        {
            string settingsFileName = string.Format("{0}\\ServiceSettings.xml", m_TempPath);
            SettingsManager settingsManager = new SettingsManager(settingsFileName);
            settingsManager.ServiceGuid = s_TestServiceGuid;

            StackHashContextSettings settings = settingsManager.CreateNewContextSettings();
            settings.ErrorIndexSettings.Folder = m_TempPath;
            settings.ErrorIndexSettings.Name = "TestIndex";
            settings.ErrorIndexSettings.Type = ErrorIndexType.Xml;

            ScriptManager scriptManager = new ScriptManager(m_ScriptPath);
            IDebugger debugger = new Windbg();

            settings.WinQualSettings.UserName = "******";
            settings.WinQualSettings.Password = "******";
            settings.WinQualSyncSchedule = new ScheduleCollection();
            Schedule schedule = new Schedule();
            schedule.Period = SchedulePeriod.Daily;
            schedule.DaysOfWeek = Schedule.EveryDay;

            DateTime now = DateTime.Now; // Must get local time.
            DateTime syncTime = now.AddSeconds(100);

            schedule.Time = new ScheduleTime(syncTime.Hour, syncTime.Minute, syncTime.Second);
            settings.WinQualSyncSchedule.Add(schedule);

            string licenseFileName = string.Format("{0}\\License.bin", m_TempPath);
            LicenseManager licenseManager = new LicenseManager(licenseFileName, s_TestServiceGuid);
            licenseManager.SetLicense(s_LicenseId);


            ControllerContext context = new ControllerContext(settings, scriptManager, debugger, settingsManager, true, StackHashTestData.Default, licenseManager);
            context.AdminReports += new EventHandler<AdminReportEventArgs>(this.OnAdminReport);

            try
            {
                context.Activate();


                // Create and delete some new context settings - should have no effect.
                StackHashContextSettings settings2 = settingsManager.CreateNewContextSettings();
                settingsManager.RemoveContextSettings(settings2.Id, true);

                // Change the existing active context.
                settings2.Id = 0;
                settings2.ErrorIndexSettings.Folder = m_TempPath;
                settings2.ErrorIndexSettings.Name = "TestIndex";
                settings2.ErrorIndexSettings.Type = ErrorIndexType.Xml;

                settings2.WinQualSettings.UserName = "******";
                settings2.WinQualSettings.Password = "******";
                settings2.WinQualSyncSchedule = new ScheduleCollection();
                schedule = new Schedule();
                schedule.Period = SchedulePeriod.Hourly;
                schedule.DaysOfWeek = Schedule.EveryDay;

                now = DateTime.Now;
                syncTime = now.AddSeconds(5);

                schedule.Time = new ScheduleTime(syncTime.Hour, syncTime.Minute, syncTime.Second);
                settings2.WinQualSyncSchedule.Add(schedule);

                context.UpdateSettings(settings2);

                // Wait for the timer to expire.
                Assert.AreEqual(true, m_WinQualSyncEvent.WaitOne(10000));
                Assert.AreEqual(true, m_AnalyzeEvent.WaitOne(10000));

                Assert.AreEqual(1, m_SyncCount);
                Assert.AreEqual(1, m_AnalyzeCount);

                context.Deactivate();
                Assert.AreEqual(false, context.IsActive);
                Assert.AreEqual(null, context.WinQualSyncTimerTask);
            }
            finally
            {
                context.AdminReports -= new EventHandler<AdminReportEventArgs>(this.OnAdminReport);
                context.Dispose();
            }
        }