public async Task CanLogin(string token, string user, string password) { ConfigureAuthToken(token); await client.Login(user, password); Assert.Equal(token, client.SessionToken); _http.ShouldHaveCalled("*/login").WithVerb(HttpMethod.Post).WithRequestBody($"principal={user}&password={password}").Times(1); }
public async Task CanLoginOn170WhenForced(string token, string user, string password) { _http.ResponseQueue.Clear(); _http.RespondWith("", cookies: new { sid = token }); var sut = new HarborClient("http://localhost:5555/", LoginBehavior.ForcePost17); await sut.Login(user, password); Assert.Equal(token, sut.SessionToken); _http.ShouldHaveCalled("*/c/login").WithVerb(HttpMethod.Post).WithRequestBody($"principal={user}&password={password}").Times(1); _http.ShouldNotHaveCalled("*/api/systeminfo"); }