本文整理汇总了C#中StepType类的典型用法代码示例。如果您正苦于以下问题:C# StepType类的具体用法?C# StepType怎么用?C# StepType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StepType类属于命名空间,在下文中一共展示了StepType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DebugResponse
public DebugResponse(string roomID, List<int> breakpoints, StepType step, bool action)
{
RoomID = roomID;
Breakpoints = breakpoints;
Step = step;
Action = action;
}
开发者ID:Shuffle-Game,项目名称:ShufflySharp,代码行数:7,代码来源:CreateDebugGameRequest.cs
示例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);
}
开发者ID:CaseyMacPherson,项目名称:Kekiri,代码行数:7,代码来源:StepName.cs
示例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);
}
开发者ID:ebelew,项目名称:Kekiri,代码行数:29,代码来源:MainWindow.xaml.cs
示例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);
}
}
开发者ID:Fody,项目名称:Obsolete,代码行数:29,代码来源:VersionExtensions.cs
示例5: BaseStep
protected BaseStep(bool runOnce, int stepOrder, StepType type, Stream sourceStream = null)
{
RunOnce = runOnce;
StepOrder = stepOrder;
Type = type;
SourceStream = sourceStream;
}
开发者ID:abdelmawla,项目名称:Consolidated-Database,代码行数:7,代码来源:BaseStep.cs
示例6: SetDefaultDebuggable
void IDebuggable.Step(StepType type)
{
if (_selectedDebuggable == null)
{
SetDefaultDebuggable();
}
_selectedDebuggable.Step(type);
}
开发者ID:SaxxonPike,项目名称:BizHawk,代码行数:8,代码来源:C64.IDebuggable.cs
示例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");
}
开发者ID:madelson,项目名称:LinqToHadoop,代码行数:8,代码来源:QueryCompiler.cs
示例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();
}
开发者ID:kcamp,项目名称:Kekiri,代码行数:58,代码来源:MainWindow.xaml.cs
示例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);
}
开发者ID:CaseyMacPherson,项目名称:Kekiri,代码行数:9,代码来源:StepMethodInvoker.cs
示例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));
}
开发者ID:robi-y,项目名称:xbehave.net,代码行数:9,代码来源:StringExtensionsSpecifications.cs
示例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);
}
开发者ID:CaseyMacPherson,项目名称:Kekiri,代码行数:10,代码来源:StepClassInvoker.cs
示例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
}
开发者ID:alvarogzp,项目名称:nextation,代码行数:10,代码来源:BaseMovement.cs
示例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));
}
开发者ID:hitesh97,项目名称:xbehave.net,代码行数:11,代码来源:StringExtensionsSpecifications.cs
示例14: CanStep
public bool CanStep(StepType type)
{
switch (type)
{
case StepType.Into:
case StepType.Over:
case StepType.Out:
return true;
default:
return false;
}
}
开发者ID:cas1993per,项目名称:bizhawk,代码行数:12,代码来源:AppleII.IDebuggable.cs
示例15: switch
bool IDebuggable.CanStep(StepType type)
{
switch (type)
{
case StepType.Into:
case StepType.Over:
case StepType.Out:
return DebuggerStep != null;
default:
return false;
}
}
开发者ID:SaxxonPike,项目名称:BizHawk,代码行数:12,代码来源:Drive1541.IDebuggable.cs
示例16: GetStep
public string GetStep(StepType stepType)
{
switch (stepType)
{
case StepType.Given:
return _settings.Given;
case StepType.When:
return _settings.When;
case StepType.Then:
return _settings.Then;
default:
throw new NotSupportedException(string.Format("Unknown step type: {0}", stepType));
}
}
开发者ID:kevintavog,项目名称:Kekiri,代码行数:14,代码来源:GherkinTestFrameworkSettingsFacade.cs
示例17: Step
public void Step(StepType type)
{
switch (type)
{
case StepType.Into:
StepInto();
break;
case StepType.Out:
StepOut();
break;
case StepType.Over:
StepOver();
break;
}
}
开发者ID:henke37,项目名称:BizHawk,代码行数:15,代码来源:C64.IDebuggable.cs
示例18: GetOutline
private string GetOutline(StepType stepType, string name)
{
var stepNameSansStepType = GetStepNameWithoutTypeNorSeperators(stepType, name);
if (string.IsNullOrWhiteSpace(stepNameSansStepType))
{
// no conversion to _ or PascalCase necessary -- bail
return string.Empty;
}
var outline = stepNameSansStepType.AsSentence();
return outline.StartsWithMultipleUppercaseLetters()
? outline
: outline.WithFirstLetterLowercase();
}
开发者ID:CaseyMacPherson,项目名称:Kekiri,代码行数:16,代码来源:StepName.cs
示例19: ActionStepMethod
public ActionStepMethod(MethodInfo info, StepAttribute attribute)
{
if (attribute is GivenAttribute)
{
stepType = StepType.Given;
}
if (attribute is WhenAttribute)
{
stepType = StepType.When;
}
if (attribute is ThenAttribute)
{
stepType = StepType.Then;
}
text = attribute.Text;
methodInfo = info;
}
开发者ID:jlundstocholm,项目名称:DillPickle,代码行数:20,代码来源:ActionStepMethod.cs
示例20: Decrement
public static SemanticVersion Decrement(this SemanticVersion target, StepType stepType)
{
switch (stepType)
{
case StepType.Major:
if (target.Major == 0)
{
throw new WeavingException($"Can not derive `TreatAsErrorFromVersion` from '{target}' since Major is 0.");
}
return new SemanticVersion
{
Major = target.Major -1,
Minor = 0,
Patch = 0
};
case StepType.Minor:
if (target.Minor == 0)
{
throw new WeavingException($"Can not derive `TreatAsErrorFromVersion` from '{target}' since Minor is 0.");
}
return new SemanticVersion
{
Major = target.Major,
Minor = target.Minor - 1,
Patch = 0
};
case StepType.Patch:
if (target.Patch == 0)
{
throw new WeavingException($"Can not derive `TreatAsErrorFromVersion` from '{target}' since Patch is 0.");
}
return new SemanticVersion
{
Major = target.Major,
Minor = target.Minor,
Patch = target.Patch - 1
};
default:
throw new Exception("Unknown StepType: " + stepType);
}
}
开发者ID:Fody,项目名称:Obsolete,代码行数:41,代码来源:VersionExtensions.cs
注:本文中的StepType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论