本文整理汇总了C#中StepType类的典型用法代码示例。如果您正苦于以下问题:C# StepType类的具体用法?C# StepType怎么用?C# StepType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StepType类属于命名空间,在下文中一共展示了StepType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DebugResponse
public DebugResponse(string roomID, List<int> breakpoints, StepType step, bool action)
{
RoomID = roomID;
Breakpoints = breakpoints;
Step = step;
Action = action;
}
示例2: StepName
public StepName(StepType stepType, string name, IEnumerable<KeyValuePair<string, object>> substitutionParameters = null)
{
StepType = stepType;
SeparatorToken = GetSeparatorToken(stepType, name);
Outline = GetOutline(stepType, name);
PrettyName = SubstituteParameters(Outline, substitutionParameters);
}
示例3: ProcessStepLine
private string ProcessStepLine(string stepLine, StepType stepType)
{
string str = stepLine;
var stepToken = stepType.ToString();
const string andToken = "And";
if (str.StartsWith(andToken, StringComparison.InvariantCultureIgnoreCase))
{
str = str.Substring(andToken.Length);
stepToken = andToken;
}
const string butToken = "But";
if (str.StartsWith(butToken, StringComparison.InvariantCultureIgnoreCase))
{
str = str.Substring(butToken.Length);
stepToken = butToken;
}
if (str.StartsWith(stepToken, StringComparison.InvariantCultureIgnoreCase))
{
str = str.Substring(stepToken.Length);
}
str = Sanitize(str);
return string.Format("{0}_{1}", stepToken, str);
}
示例4: Increment
public static SemanticVersion Increment(this SemanticVersion target, StepType stepType)
{
switch (stepType)
{
case StepType.Major:
return new SemanticVersion
{
Major = target.Major + 1,
Minor = 0,
Patch = 0
};
case StepType.Minor:
return new SemanticVersion
{
Major = target.Major,
Minor = target.Minor + 1,
Patch = 0
};
case StepType.Patch:
return new SemanticVersion
{
Major = target.Major,
Minor = target.Minor,
Patch = target.Patch + 1
};
default:
throw new Exception("Unknown StepType: " + stepType);
}
}
示例5: BaseStep
protected BaseStep(bool runOnce, int stepOrder, StepType type, Stream sourceStream = null)
{
RunOnce = runOnce;
StepOrder = stepOrder;
Type = type;
SourceStream = sourceStream;
}
示例6: SetDefaultDebuggable
void IDebuggable.Step(StepType type)
{
if (_selectedDebuggable == null)
{
SetDefaultDebuggable();
}
_selectedDebuggable.Step(type);
}
示例7: MapReduceStep
public MapReduceStep(LambdaExpression Expression, StepType type)
{
this.Expression = Expression;
this.Type = type;
Throw.If(this.InputType.GetGenericTypeDefinition() != typeof(KeyValuePair<,>), this.InputType.Name + " is not a key value pair");
Throw.If(this.OutputType.GetGenericTypeDefinition() != typeof(KeyValuePair<,>), this.OutputType.Name + " is not a key value pair");
}
示例8: ProcessScenarioLine
private void ProcessScenarioLine(ScenarioStyle style, string line, ref StepType stepType, StringBuilder builder)
{
if (stepType == StepType.When)
{
stepType = StepType.Then;
}
if (line.StartsWith("When"))
{
stepType = StepType.When;
}
const string tagToken = "@";
if (line.StartsWith(tagToken))
{
var tags = line.Split('@');
foreach (var tag in tags
.Select(t => t.Trim().Trim('@'))
.Where(t => !string.IsNullOrWhiteSpace(t)))
{
builder.AppendLine($" [Tag(\"{tag}\")]");
}
return;
}
const string scenarioToken = "Scenario:";
if (line.StartsWith(scenarioToken))
{
if (style == ScenarioStyle.Classic) builder.AppendLine(" [Scenario(Feature.Unknown)]");
string className = Sanitize(line.Substring(scenarioToken.Length));
builder.AppendLine($" public class {className} : {GetScenarioTypeName(style)}");
builder.AppendLine(" {");
if (style == ScenarioStyle.Fluent)
{
builder.AppendLine($" public {className}()");
builder.AppendLine(" {");
builder.AppendLine(" TODO");
builder.AppendLine(" }");
builder.AppendLine();
}
return;
}
if (line.StartsWith("-> done: "))
{
return;
}
var methodName = ProcessStepLine(line, stepType);
if (style == ScenarioStyle.Classic) builder.AppendLine($" [{stepType}]");
builder.AppendLine($" {GetAccessModifierForStep(style)}void {methodName}()");
builder.AppendLine(" {");
builder.AppendLine(" }");
builder.AppendLine();
}
示例9: StepMethodInvoker
public StepMethodInvoker(StepType stepType, MethodBase method, KeyValuePair<string, object>[] supportedParameters = null)
{
Method = method;
Type = stepType;
Parameters = method.BindParameters(supportedParameters);
Name = new StepName(Type, method.Name, supportedParameters);
ExceptionExpected = method.AttributeOrDefault<ThrowsAttribute>() != null;
SourceDescription = string.Format("{0}.{1}", method.DeclaringType.FullName, method.Name);
}
示例10: GetStepType
public void GetStepType(string clause, StepType expected, StepType actual)
{
"Given a string starts with '{0}'"
.Given(() => clause = clause + " foo");
"When GetStepType() is called"
.When(() => actual = StringExtensions.GetStepType(clause));
"Then StepType.{1} is returned"
.Then(() => actual.Should().Be(expected));
}
示例11: StepClassInvoker
public StepClassInvoker(StepType stepType, Type stepClass, KeyValuePair<string,object>[] supportedParameters, IExceptionHandler exceptionHandler)
{
if (!typeof(Step).IsAssignableFrom(stepClass))
throw new ArgumentException("The stepClass must inherit from Step", "stepClass");
_stepClass = stepClass;
_exceptionHandler = exceptionHandler;
Type = stepType;
Name = new StepName(Type, _stepClass.Name, supportedParameters);
Parameters = _stepClass.GetConstructors().Single().BindParameters(supportedParameters);
}
示例12: BaseMovement
public BaseMovement(Transform transform, float speed, StepType step, bool terrestrial, Vector3? offset)
{
this.transform = transform;
this.speed = speed;
this.step = step;
this.terrestrial = terrestrial;
this.offset = offset == null ? Vector3.zero : (Vector3) offset;
this.phase = 1; // Movement start ended
}
示例13: GetStepType
public static void GetStepType(string clause, StepType expected, StepType actual)
{
"Given a string starts with '{0}'"
.Given(() => clause = clause + " foo");
"When getting the step type"
.When(() => actual = StringExtensions.GetStepType(clause));
"Then the step type is '{1}'"
.Then(() => actual.Should().Be(expected));
}
示例14: CanStep
public bool CanStep(StepType type)
{
switch (type)
{
case StepType.Into:
case StepType.Over:
case StepType.Out:
return true;
default:
return false;
}
}
示例15: switch
bool IDebuggable.CanStep(StepType type)
{
switch (type)
{
case StepType.Into:
case StepType.Over:
case StepType.Out:
return DebuggerStep != null;
default:
return false;
}
}