本文整理汇总了C#中Step类的典型用法代码示例。如果您正苦于以下问题:C# Step类的具体用法?C# Step怎么用?C# Step使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Step类属于命名空间,在下文中一共展示了Step类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Matches
public bool Matches(MethodInfo Method, Step Step)
{
this.Method = Method;
this.Step = Step;
return MatchesName && MatchesArgs;
}
开发者ID:rossbeehler,项目名称:raconteur,代码行数:7,代码来源:StepCompiler.cs
示例2: ReportOnStep
void ReportOnStep(Scenario scenario, Step step)
{
var message =
string.Format
("\t{0} [{1}] ",
PrefixWithSpaceIfRequired(step).PadRight(_longestStepSentence + 5),
Configurator.Scanners.Humanize(step.Result.ToString()));
// if all the steps have passed, there is no reason to make noise
if (scenario.Result == Result.Passed)
message = "\t" + PrefixWithSpaceIfRequired(step);
if (step.Exception != null)
{
_exceptions.Add(step.Exception);
var exceptionReference = string.Format("[Details at {0} below]", _exceptions.Count);
if (!string.IsNullOrEmpty(step.Exception.Message))
message += string.Format("[{0}] {1}", FlattenExceptionMessage(step.Exception.Message), exceptionReference);
else
message += string.Format("{0}", exceptionReference);
}
if (step.Result == Result.Inconclusive || step.Result == Result.NotImplemented)
Console.ForegroundColor = ConsoleColor.Yellow;
else if (step.Result == Result.Failed)
Console.ForegroundColor = ConsoleColor.Red;
else if (step.Result == Result.NotExecuted)
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(message);
Console.ForegroundColor = ConsoleColor.White;
}
开发者ID:rajeshpillai,项目名称:TestStack.BDDfy,代码行数:33,代码来源:ConsoleReporter.cs
示例3: AssertStep
private static void AssertStep(Step step, string stepTitle, ExecutionOrder order, bool asserts = false, bool shouldReport = true)
{
Assert.That(step.Title.Trim(), Is.EqualTo(stepTitle));
Assert.That(step.Asserts, Is.EqualTo(asserts));
Assert.That(step.ExecutionOrder, Is.EqualTo(order));
Assert.That(step.ShouldReport, Is.EqualTo(shouldReport));
}
开发者ID:JakeGinnivan,项目名称:TestStack.BDDfy,代码行数:7,代码来源:WhenStepsReturnTheirText.cs
示例4: ThenSingleScenarioWithStepsAddedSuccessfully
public void ThenSingleScenarioWithStepsAddedSuccessfully()
{
var excelScenarioFormatter = Container.Resolve<ExcelScenarioFormatter>();
var scenario = new Scenario
{
Name = "Test Feature",
Description =
"In order to test this feature,\nAs a developer\nI want to test this feature"
};
var given = new Step {NativeKeyword = "Given", Name = "a precondition"};
var when = new Step {NativeKeyword = "When", Name = "an event occurs"};
var then = new Step {NativeKeyword = "Then", Name = "a postcondition"};
scenario.Steps = new List<Step>(new[] {given, when, then});
using (var workbook = new XLWorkbook())
{
IXLWorksheet worksheet = workbook.AddWorksheet("SHEET1");
int row = 3;
excelScenarioFormatter.Format(worksheet, scenario, ref row);
worksheet.Cell("B3").Value.ShouldEqual(scenario.Name);
worksheet.Cell("C4").Value.ShouldEqual(scenario.Description);
row.ShouldEqual(8);
}
}
开发者ID:Jaykul,项目名称:pickles,代码行数:25,代码来源:WhenAddingAScenarioToAWorksheet.cs
示例5: Start
void Start()
{
mDownloader = new AssetDownloader();
mPreStep = Step.None;
mStep = Step.HashmapHash;
// 读取本地的配置列表
string localFiles = UrlUtil.Combine(Settings.UNITY_RAW_FOLDER, "files");
if (File.Exists(localFiles))
{
string[] array = File.ReadAllLines(localFiles);
mLocalCfgMap = new Dictionary<string, AssetCfg>(array.Length);
for (int i = 0; i < array.Length; i++)
{
string line = array[i];
if (string.IsNullOrEmpty(line))
continue;
string[] cells = line.Split('|');
if (cells == null || cells.Length == 0)
continue;
AssetCfg cfg = new AssetCfg(cells);
mLocalCfgMap.Add(cfg.key, cfg);
}
}
else
{
mLocalCfgMap = new Dictionary<string, AssetCfg>();
}
}
开发者ID:zeronely,项目名称:View,代码行数:29,代码来源:AssetUpdater.cs
示例6: GetMatch
public StepMatch GetMatch(Step step, ActionStepMethod stepMethod)
{
if (step.StepType != stepMethod.StepType) return StepMatch.NoMatch(step);
var stepTokens = Tokenize(step.Text);
var methodTokens = Tokenize(stepMethod.Text);
if (stepTokens.Length != methodTokens.Length) return StepMatch.NoMatch(step);
var tokens = new List<Token>();
for (var index = 0; index < stepTokens.Length; index++)
{
var tok1 = stepTokens[index];
var tok2 = methodTokens[index];
if (tok2 is VariableToken)
{
((VariableToken) tok2).Value = tok1.Text;
tokens.Add(tok2);
continue;
}
if (tok1.Text != tok2.Text)
{
return StepMatch.NoMatch(step);
}
tokens.Add(tok1);
}
return new StepMatch(step) {IsMatch = true, Tokens = tokens};
}
开发者ID:jlundstocholm,项目名称:DillPickle,代码行数:33,代码来源:StepMatcher.cs
示例7: Apply
public override void Apply(Step step)
{
var databaseExists = DatabaseExists();
foreach (var script in step.Scripts)
{
if (!script.HasContent()) continue;
try
{
if (databaseExists)
{
var executeScriptResult = ExecuteScript(script);
ExamineForScriptError(executeScriptResult);
}
else
{
var executeScriptOnMasterResult = ExecuteScriptOnMaster(script);
ExamineForScriptError(executeScriptOnMasterResult);
}
}
catch (Exception scriptException)
{
RaiseOnScriptFailure(script, scriptException);
}
RaiseOnScriptSuccess(script);
}
}
开发者ID:limitzero,项目名称:db-advance,代码行数:29,代码来源:SqlCmdDatabaseConnector.cs
示例8: EnsureComplete_should_throw_if_minimum_count_not_met
public void EnsureComplete_should_throw_if_minimum_count_not_met()
{
var step = new Step(Times.Once());
Assert.Throws<SequenceException>(() => step.EnsureComplete(""));
Assert.That(step.Complete, Is.False);
}
开发者ID:kellyselden,项目名称:Moq-Sequences,代码行数:7,代码来源:StepTest.cs
示例9: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
Action<IDataReader> action = DisplayRow;
context.AddPublishedItem("Row Action", step.Id, action);
context.AddPublishedItem("String", step.Id, queryName);
context.AddPublishedItem("Configuration Info", step.Id, this);
}
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:7,代码来源:PublishRowActionForQuery1.cs
示例10: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
string first = step.GetParameterValue<string>("String", 1);
string second = step.GetParameterValue<string>("String", 2);
ServiceAgent.Currency from = (ServiceAgent.Currency)Enum.Parse(typeof(ServiceAgent.Currency), first, true);
ServiceAgent.Currency to = (ServiceAgent.Currency)Enum.Parse(typeof(ServiceAgent.Currency), second, true);
ConfigurationChannelFactory<ServiceAgent.CurrencyConvertorSoap> channelFactory = null;
double rate;
try
{
channelFactory = new ConfigurationChannelFactory<ServiceAgent.CurrencyConvertorSoap>("CurrencyConvertorSoap", conf.Configuration, null);
var client = channelFactory.CreateChannel();
rate = client.ConversionRate(from, to);
}
catch (Exception)
{
rate = double.NaN;
}
finally
{
if (channelFactory != null)
channelFactory.Close();
}
context.AddPublishedItem("Number", step.Id, rate);
}
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:28,代码来源:GetExchangeRate.cs
示例11: AssertStep
private static void AssertStep(Step step, string stepTitle, ExecutionOrder order, bool asserts = false, bool shouldReport = true)
{
step.Title.Trim().ShouldBe(stepTitle);
step.Asserts.ShouldBe(asserts);
step.ExecutionOrder.ShouldBe(order);
step.ShouldReport.ShouldBe(shouldReport);
}
开发者ID:rronen10,项目名称:TestStack.BDDfy,代码行数:7,代码来源:WhenStepsReturnTheirText.cs
示例12: Move
public Move(Step step, Board board)
{
_board = board;
Step = new Step(step);
oldFrom = _board[(step.FromX << 3) + step.FromY];
oldTo = _board[(step.ToX << 3) + step.ToY];
}
开发者ID:KarelinDmitriy,项目名称:SIILaba,代码行数:7,代码来源:Move.cs
示例13: CodeFunctionForUnimplemented
static CodeFunction CodeFunctionForUnimplemented(this Project project, Step Step)
{
return project.Classes()
.Where(x => x.Name == Step.Feature.Name)
.SelectMany(x => x.Functions())
.FirstOrDefault(x => x.EqualsTo(Step));
}
开发者ID:rossbeehler,项目名称:raconteur,代码行数:7,代码来源:ProjectEx.cs
示例14: Waiter
public Waiter(Step step, Action completed = null, int timesToComplete = 1)
{
_time = new WaiterTime();
_step = step;
_timesToComplete = timesToComplete;
_completed = completed;
}
开发者ID:victorMoneratto,项目名称:infinite-island,代码行数:7,代码来源:Wait.cs
示例15: Action
/// <summary>
/// Creates instance of the <see cref="Action"></see> class with properties initialized with specified parameters.
/// </summary>
/// <param name="returnType">The return type of the action.</param>
/// <param name="when"><see cref="T:WixSharp.When"/> the action should be executed with respect to the <paramref name="step"/> parameter.</param>
/// <param name="step"><see cref="T:WixSharp.Step"/> the action should be executed before/after during the installation.</param>
/// <param name="condition">The launch condition for the <see cref="Action"/>.</param>
protected Action(Return returnType, When when, Step step, Condition condition)
{
Return = returnType;
Step = step;
When = when;
Condition = condition;
}
开发者ID:denis-peshkov,项目名称:WixSharp,代码行数:14,代码来源:Action.cs
示例16: NoMatch
public static StepMatch NoMatch(Step step)
{
return new StepMatch(step)
{
IsMatch = false,
};
}
开发者ID:jlundstocholm,项目名称:DillPickle,代码行数:7,代码来源:StepMatch.cs
示例17: WriteStep
public static void WriteStep(this XmlElement parent, Step step)
{
var element = parent.AddElement(step.Key);
step.Values.Each(pair => element.SetAttribute(pair.Key, pair.Value));
step.Collections.Each(element.WriteSection);
}
开发者ID:jamesmanning,项目名称:Storyteller,代码行数:7,代码来源:XmlExtensions.cs
示例18: Start
void Start()
{
toggles = GameObject.Find("TowerChoice").GetComponentsInChildren<Toggle>();
choiceTowers = new Dictionary<TglTower, Tower>();
retrieveChoiceTowers();
DisableChoices();
title = GameObject.Find("txtTitle");
title.SetActive(false);
smallTitle = GameObject.Find("txtSmallTitle");
tiltShift = GameObject.Find("Main Camera").GetComponent<UnityStandardAssets.ImageEffects.TiltShift>();
spawnLaps = 2;
spawner = GameObject.Find("Spawn").GetComponentInChildren<Spawn>();
step = Step.STARTING;
shakeAmount = 0.1F;
shakeTimer = 1F;
HideTowerDetails();
btnNextWave.onClick.AddListener(EndConstructionTime);
nextWave = GameObject.Find("btnNextWave");
nextWave.SetActive(false);
animator = ((Animator)GetComponent<Animator>());
topCam = (Camera) topCamObject.GetComponent<Camera> ();
animator.Play("CameraStartAnim", -1, 0F);
startTimer = Time.time;
}
开发者ID:Samoustique,项目名称:TowerDefense,代码行数:29,代码来源:GameManager.cs
示例19: ExecuteStep
public Result ExecuteStep(Step step)
{
try
{
step.Execute(_scenario.TestObject);
step.Result = Result.Passed;
}
catch (Exception ex)
{
// ToDo: more thought should be put into this. Is it safe to get the exception?
var exception = ex;
if (exception is TargetInvocationException)
{
exception = ex.InnerException ?? ex;
}
if (exception is NotImplementedException)
{
step.Result = Result.NotImplemented;
step.Exception = exception;
}
else if (IsInconclusive(exception))
{
step.Result = Result.Inconclusive;
step.Exception = exception;
}
else
{
step.Exception = exception;
step.Result = Result.Failed;
}
}
return step.Result;
}
开发者ID:jason-roberts,项目名称:TestStack.BDDfy,代码行数:35,代码来源:ScenarioExecutor.cs
示例20: SetNextStep
/// <summary>
/// Sets next model's step
/// </summary>
/// <param name="step"></param>
protected void SetNextStep(Step step)
{
if (_initialStep == null)
_initialStep = step;
Steps.Clear();
Steps.Add(0, step);
}
开发者ID:vrudkovskiy,项目名称:teachframework,代码行数:11,代码来源:AbstractDynamicModel.cs
注:本文中的Step类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论