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