public void GetPreRequisit()
 {
     Detector detector = new Detector();
     detector.Load(@"..\..\..\SampleDetector\bin\Debug\SampleDetector.dll");
     Microsoft.Protocols.TestManager.Detector.Prerequisites prerequisits = detector.GetPrerequisits();
     Assert.AreEqual("Summary", prerequisits.Summary,"Verify Summary.");
     Assert.AreEqual(3, prerequisits.Properties.Count, "Verify propertie number.");
 }
 public void TestAsyncDetection()
 {
     Detector detector = new Detector();
     detector.Load(@"..\..\..\SampleDetector\bin\Debug\SampleDetector.dll");
     Microsoft.Protocols.TestManager.Detector.Prerequisites prerequisits = detector.GetPrerequisits();
     AutoResetEvent autoEvent = new AutoResetEvent(false);
     DetectionOutcome outcome = null;
     detector.BeginDetection((o) =>
         {
             outcome = o;
             autoEvent.Set();
         }
     );
     autoEvent.WaitOne();
     Assert.AreEqual(DetectionStatus.Error, outcome.Status, "Error should occur");
     Assert.IsNotNull(outcome.Exception, "Check exception");
 }
        /// <summary>
        /// Initializes the auto-detection plug-in.
        /// </summary>
        public void InitializeDetector()
        {
            Microsoft.Protocols.TestManager.Detector.UtilCallBackFunctions.GetPropertyValue = (string name) =>
            {
                var property = ptfconfig.GetPropertyNodeByName(name);
                if (property != null) return property.Value;
                return null;
            };

            Microsoft.Protocols.TestManager.Detector.UtilCallBackFunctions.GetPropertiesByFile = (filename) =>
                {
                    if (!ptfconfig.FileProperties.ContainsKey(filename))
                        return null;
                    return ptfconfig.FileProperties[filename];
                };
            detector = new Detector();
            detector.Load(appConfig.DetectorAssemblyPath);
        }
 public void LoadDetectorAssembly()
 {
     Detector detector = new Detector();
     detector.Load(@"..\..\..\SampleDetector\bin\Debug\SampleDetector.dll");
 }