public static string GetNextPictureName(FeatureContext featureContext, ScenarioContext scenarioContext)
        {
            Assert.NotNull(featureContext);
            Assert.NotNull(scenarioContext);

            lock (featureContext)
            lock (scenarioContext)
            {
                object objectPictureIndex;
                if (!scenarioContext.TryGetValue(EmuPictureIndexKey, out objectPictureIndex))
                    objectPictureIndex = 0;
                var pictureIndex = (int) objectPictureIndex;
                scenarioContext[EmuPictureIndexKey] = ++pictureIndex;

                var fileName = String.Format("{0}{1}_{2}_{3}.png",
                                                EmuShotPrefix,
                                                featureContext.FeatureInfo.Title,
                                                scenarioContext.ScenarioInfo.Title,
                                                pictureIndex);

                foreach (var ch in Path.GetInvalidFileNameChars())
                    fileName = fileName.Replace(ch, '_');

                return fileName;
            }
        }
        public FeatureContextExtended(FeatureContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            this.context = context;
        }
Esempio n. 3
0
 internal static void DisableSingletonInstance()
 {
     isCurrentDisabled = true;
     Thread.MemoryBarrier();
     current = null;
 }
Esempio n. 4
0
 public CommonLocators(FeatureContext featureContext)
 {
   this.featureContext = featureContext;
 }
        public static Random GetRandom(FeatureContext featureContext, ScenarioContext scenarioContext)
        {
            Assert.NotNull(featureContext);
            Assert.NotNull(scenarioContext);

            object randomObject;
            if (featureContext.TryGetValue(EmuRandomGeneratorKey, out randomObject))
            {
                if (randomObject is Random)
                    return randomObject as Random;
            }

            var random = new Random();
            featureContext[EmuRandomGeneratorKey] = random;
            return random;
        }
 public static string GetNextPictureName(FeatureContext featureContext, ScenarioContext scenarioContext)
 {
     return GetNextSupportingInfoFileName(featureContext, scenarioContext, EmuShotPrefix, "png");
 }
 public ScenarioHooks(BoardStateContext injectedContext, FeatureContext featureContext)
 {
     _context        = injectedContext;
     _featureContext = featureContext;
 }
Esempio n. 8
0
 public NavigationStepsBase(FeatureContext featureContext)
 {
   this.featureContext = featureContext;
   this.commonLocators = new CommonLocators(featureContext);
 }
Esempio n. 9
0
 internal static void DisableSingletonInstance()
 {
     isCurrentDisabled = true;
     Thread.MemoryBarrier();
     current = null;
 }
Esempio n. 10
0
 private static void DisposeFeatureContext()
 {
     ((IDisposable)featureContext).Dispose();
     featureContext = null;
 }
Esempio n. 11
0
 public SocialLocators(FeatureContext featureContext)
 {
   this.featureContext = featureContext;
 }
Esempio n. 12
0
 public CommonActions(FeatureContext featureContext)
 {
   this.featureContext = featureContext;
   this.locators = new CommonLocators(featureContext);
 }