// [InlineData(AuthenticateEndpoints.Refresh)] // [InlineData(AuthenticateEndpoints.Validate)] // [InlineData(AuthenticateEndpoints.Invalidate)] // [InlineData(AuthenticateEndpoints.Signout)] public void Test3(AuthenticateEndpoints authenticateEndpoints) { var expect = "authenticate"; var actual = authenticateEndpoints.GetValue(); Assert.Equal(expect, actual); }
public static string GetPayload(this OnlineAuthenticator authenticator, AuthenticateEndpoints endpoints) { switch (endpoints) { case AuthenticateEndpoints.Authenticate: return(GetAuthenticatePayload(authenticator)); case AuthenticateEndpoints.Signout: return(GetSignoutPayload(authenticator)); case AuthenticateEndpoints.Refresh: case AuthenticateEndpoints.Validate: case AuthenticateEndpoints.Invalidate: throw new ArgumentOutOfRangeException(nameof(endpoints), endpoints, null); default: throw new ArgumentOutOfRangeException(nameof(endpoints), endpoints, null); } }
public static async Task <HttpResponse> Post(AuthenticateEndpoints endpoints, string json) { return(await Post($"https://authserver.mojang.com/{endpoints.GetValue()}", json)); }
public static string GetValue(this AuthenticateEndpoints ex) { return(ex.ToString().ToLower()); }