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;
        }
示例#3
0
 internal static void DisableSingletonInstance()
 {
     isCurrentDisabled = true;
     Thread.MemoryBarrier();
     current = null;
 }
示例#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;
 }
示例#8
0
 public NavigationStepsBase(FeatureContext featureContext)
 {
   this.featureContext = featureContext;
   this.commonLocators = new CommonLocators(featureContext);
 }
示例#9
0
 internal static void DisableSingletonInstance()
 {
     isCurrentDisabled = true;
     Thread.MemoryBarrier();
     current = null;
 }
示例#10
0
 private static void DisposeFeatureContext()
 {
     ((IDisposable)featureContext).Dispose();
     featureContext = null;
 }
示例#11
0
 public SocialLocators(FeatureContext featureContext)
 {
   this.featureContext = featureContext;
 }
示例#12
0
 public CommonActions(FeatureContext featureContext)
 {
   this.featureContext = featureContext;
   this.locators = new CommonLocators(featureContext);
 }