本文整理汇总了C#中Context.ValidateContext方法的典型用法代码示例。如果您正苦于以下问题:C# Context.ValidateContext方法的具体用法?C# Context.ValidateContext怎么用?C# Context.ValidateContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context.ValidateContext方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThrowsExceptionForMissingVersion
public void ThrowsExceptionForMissingVersion()
{
var context = new Context
{
BranchName = "master"
};
ExceptionTester.CallMethodAndExpectException<ContinuaInitException>(() => context.ValidateContext());
}
示例2: ThrowsExceptionForMissingTargetUrl
public void ThrowsExceptionForMissingTargetUrl()
{
var context = new Context(new ProviderManager())
{
SolutionDirectory = @"c:\source\GitLink",
};
ExceptionTester.CallMethodAndExpectException<GitLinkException>(() => context.ValidateContext());
}
示例3: ThrowsExceptionForMissingConfigurationName
public void ThrowsExceptionForMissingConfigurationName()
{
var context = new Context(new ProviderManager())
{
SolutionDirectory = @"c:\source\GitLink",
ConfigurationName = string.Empty
};
ExceptionTester.CallMethodAndExpectException<GitLinkException>(() => context.ValidateContext());
}
示例4: SucceedsForValidContext
public void SucceedsForValidContext()
{
var context = new Context
{
BranchName = "master",
Version = "1.0"
};
// should not throw
context.ValidateContext();
}
示例5: SucceedsForValidContext
public void SucceedsForValidContext()
{
var context = new Context(new ProviderManager())
{
SolutionDirectory = @"c:\source\GitLink",
TargetUrl = "https://github.com/CatenaLogic/GitLink",
};
// should not throw
context.ValidateContext();
}
示例6: ThrowsExceptionForMissingSolutionDirectory
public void ThrowsExceptionForMissingSolutionDirectory()
{
var context = new Context();
ExceptionTester.CallMethodAndExpectException<ContinuaInitException>(() => context.ValidateContext());
}
示例7: ExpandsDirectoryIfRequired
public void ExpandsDirectoryIfRequired(string solutionDirectory, string expectedValue)
{
Environment.CurrentDirectory = @"c:\";
var context = new Context(new ProviderManager());
context.TargetUrl = "https://github.com/CatenaLogic/GitLink.git";
context.SolutionDirectory = solutionDirectory;
context.ValidateContext();
Assert.AreEqual(expectedValue, context.SolutionDirectory);
}
示例8: ThrowsExceptionForMissingSolutionDirectory
public void ThrowsExceptionForMissingSolutionDirectory()
{
var context = new Context(new ProviderManager());
ExceptionTester.CallMethodAndExpectException<GitLinkException>(() => context.ValidateContext());
}