本文整理汇总了C#中Authentication类的典型用法代码示例。如果您正苦于以下问题:C# Authentication类的具体用法?C# Authentication怎么用?C# Authentication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Authentication类属于命名空间,在下文中一共展示了Authentication类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Develop_branch
public void Develop_branch()
{
var authentication = new Authentication();
var versionBuilder = new TeamCity(authentication);
var tcVersion = versionBuilder.GenerateSetVersionMessage("0.0.0-Unstable4");
Assert.AreEqual("##teamcity[buildNumber '0.0.0-Unstable4']", tcVersion);
}
示例2: EscapeValues
public void EscapeValues()
{
var authentication = new Authentication();
var versionBuilder = new MyGet(authentication);
var message = versionBuilder.GenerateSetParameterMessage("Foo", "0.8.0-unstable568 Branch:'develop' Sha:'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb'");
Assert.AreEqual("##myget[setParameter name='GitVersion.Foo' value='0.8.0-unstable568 Branch:|'develop|' Sha:|'ee69bff1087ebc95c6b43aa2124bd58f5722e0cb|'']", message[0]);
}
示例3: Build
public virtual Authentication Build()
{
Support.LogMethodEntry();
Authentication result = new Authentication(AuthenticationMethod.EMAIL);
Support.LogMethodExit(result);
return result;
}
示例4: BuildNumber
public void BuildNumber()
{
var authentication = new Authentication();
var versionBuilder = new MyGet(authentication);
var message = versionBuilder.GenerateSetParameterMessage("LegacySemVerPadded", "0.8.0-unstable568");
Assert.AreEqual("##myget[buildNumber '0.8.0-unstable568']", message[1]);
}
示例5: Develop_branch
public void Develop_branch()
{
var authentication = new Authentication();
var versionBuilder = new MyGet(authentication);
var message = versionBuilder.GenerateSetVersionMessage("0.0.0-Unstable4");
Assert.AreEqual(null, message);
}
示例6: GenerateBuildVersion
public void GenerateBuildVersion()
{
var authentication = new Authentication();
var versionBuilder = new ContinuaCi(authentication);
var continuaCiVersion = versionBuilder.GenerateSetVersionMessage("0.0.0-Beta4.7");
Assert.AreEqual("@@continua[setBuildVersion value='0.0.0-Beta4.7']", continuaCiVersion);
}
示例7: TestInitialize
public void TestInitialize()
{
_testTarget = new Authentication();
_sucessfulAuthenticationRequests = new TestAuthenticationRequests();
_testTarget.AuthenticationRequestInterface = _sucessfulAuthenticationRequests;
}
示例8: TryGetVersion
public static bool TryGetVersion(string directory, out SemanticVersion versionAndBranch)
{
var gitDirectory = GitDirFinder.TreeWalkForGitDir(directory);
if (string.IsNullOrEmpty(gitDirectory))
{
var message =
"No .git directory found in provided solution path. This means the assembly may not be versioned correctly. " +
"To fix this warning either clone the repository using git or remove the `GitVersionTask` nuget package. " +
"To temporarily work around this issue add a AssemblyInfo.cs with an appropriate `AssemblyVersionAttribute`. " +
"If it is detected that this build is occurring on a CI server an error may be thrown.";
Logger.WriteWarning(message);
versionAndBranch = null;
return false;
}
if (!processedDirectories.Contains(directory))
{
processedDirectories.Add(directory);
var authentication = new Authentication();
foreach (var buildServer in BuildServerList.GetApplicableBuildServers(authentication))
{
Logger.WriteInfo(string.Format("Executing PerformPreProcessingSteps for '{0}'.", buildServer.GetType().Name));
buildServer.PerformPreProcessingSteps(gitDirectory);
}
}
versionAndBranch = VersionCache.GetVersion(gitDirectory);
return true;
}
示例9: CreateCustomMonitor
public void CreateCustomMonitor()
{
authentication = new Authentication(apiKey: MonitisAccountInformation.ApiKey,
secretKey: MonitisAccountInformation.SekretKey);
customMonitor = new CustomMonitor();
customMonitor.SetAuthenticationParams(authentication);
agent = new CustomUserAgent();
agent.SetAuthenticationParams(authentication);
var a1 = agent.AddAgent("TestAgent1" + DateTime.Now.Ticks.ToString(), "internal", new JObject(), 100000, OutputType.JSON);
_agentID = JObject.Parse(a1.Content).Value<int>("data");
customMonitor = new CustomMonitor();
customMonitor.SetAuthenticationParams(authentication);
MonitorParameter param = new MonitorParameter("param1", "param1d", "val", DataType.String, false);
MonResultParameter resParam = new MonResultParameter("MonResparam1", "MonResparam1d", "MonResval",
DataType.String);
MonResultParameter resAddParam = new MonResultParameter("MonAddResparam1", "MonAddResparam1d",
"MonAddResval", DataType.String);
var s = customMonitor.AddMonitor(_agentID, TestCustomMonitorName + DateTime.Now.Ticks.ToString(), "Test", "internal",
new List<MonitorParameter>() { param },
new List<MonResultParameter>() { resParam },
new List<MonResultParameter>() { resAddParam });
_customMonitorID = JObject.Parse(s.Content).Value<int>("data");
GetTestMonitor();
}
示例10: AuthenticationArgs
/// <summary>
/// Authentication event arguments
/// </summary>
/// <param name="requestUri"></param>
/// <param name="realm"></param>
/// <param name="authType"></param>
internal AuthenticationArgs(Uri requestUri, string realm, Authentication authType)
{
this.Realm = realm;
this.AuthType = authType;
this.RequestUri = requestUri;
this.ProcessAuthorization = true;
}
示例11: Build
public override Authentication Build()
{
Asserts.NotEmptyOrNull (phoneNumber, "phoneNumber");
Authentication result = new Authentication(phoneNumber);
return result;
}
示例12: GetVersion
public static VersionVariables GetVersion(string directory, Authentication authentication, bool noFetch, IFileSystem fileSystem)
{
var gitDir = GitDirFinder.TreeWalkForDotGitDir(directory);
using (var repo = RepositoryLoader.GetRepo(gitDir))
{
var ticks = DirectoryDateFinder.GetLastDirectoryWrite(directory);
var key = string.Format("{0}:{1}:{2}", repo.Head.CanonicalName, repo.Head.Tip.Sha, ticks);
CachedVersion result;
if (versionCacheVersions.TryGetValue(key, out result))
{
if (result.Timestamp != ticks)
{
Logger.WriteInfo("Change detected. flushing cache.");
result.VersionVariables = ExecuteCore.ExecuteGitVersion(fileSystem, null, null, authentication, null, noFetch, directory, null);
}
return result.VersionVariables;
}
Logger.WriteInfo("Version not in cache. Calculating version.");
return (versionCacheVersions[key] = new CachedVersion
{
VersionVariables = ExecuteCore.ExecuteGitVersion(fileSystem, null, null, authentication, null, noFetch, directory, null),
Timestamp = ticks
}).VersionVariables;
}
}
示例13: MatchingService
public MatchingService()
{
dbContext = new ShowMeAroundContext();
userDA = new UserDA();
provider = new MatchingProvider();
auth = new Authentication();
}
示例14: SetupConnection
private static IEntityServices SetupConnection(int connectionId, string domainName)
{
ConnectionDto connection;
using (var db = new TenantDb(ConnectionString.ForDomain(domainName)))
{
var conn = db.Connections.Single(x => x.ConnectionId == connectionId && x.IsActive);
connection = new ConnectionDto
{
ConnectionId = conn.ConnectionId,
Url = conn.Url.Trim(),
UserName = conn.UserName.Trim(),
Password = conn.Password.Trim()
};
}
IAuthenticator authenticator = new Authentication();
IOrganizationService organizationService = authenticator.Authenticate(new AuthenticationInformation
{
OrganizationUri = connection.Url,
UserName = connection.UserName,
Password = connection.Password
});
IEntityServices entityService = new EntityServices(organizationService);
return entityService;
}
示例15: UserService
public UserService()
{
userDA = new UserDA();
sessionDA = new SessionDA();
auth = new Authentication();
interestDA = new InterestDA();
languageDA = new LanguageDA();
}