本文整理汇总了C#中RedmineManager.GetCurrentUser方法的典型用法代码示例。如果您正苦于以下问题:C# RedmineManager.GetCurrentUser方法的具体用法?C# RedmineManager.GetCurrentUser怎么用?C# RedmineManager.GetCurrentUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RedmineManager
的用法示例。
在下文中一共展示了RedmineManager.GetCurrentUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_Connect_With_Username_And_Password
public void Should_Connect_With_Username_And_Password()
{
var a = new RedmineManager(Helper.Uri, Helper.Username, Helper.Password);
var currentUser = a.GetCurrentUser();
Assert.NotNull(currentUser);
Assert.True(currentUser.Login.Equals(Helper.Username), "usernames not equals.");
}
示例2: GetCredentialsIfNeeded
private static bool GetCredentialsIfNeeded(Configuration configuration)
{
if (configuration.OpenTickets)
{
// Get use name and password
Console.Write("Redmine Username: ");
_user = Console.ReadLine();
Console.Write("Redmine password: ");
_password = Console.ReadLine();
_redmineManager = new RedmineManager(configuration.RedmineUrl, _user, _password);
try
{
_redmineManager.GetCurrentUser();
return true;
}
catch (RedmineException)
{
return false;
}
}
return true;
}
示例3: Should_Connect_With_Api_Key
public void Should_Connect_With_Api_Key()
{
var a = new RedmineManager(Helper.Uri, Helper.ApiKey);
var currentUser = a.GetCurrentUser();
Assert.NotNull(currentUser);
Assert.True(currentUser.ApiKey.Equals(Helper.ApiKey),"api keys not equals.");
}