public async Task Authenticate_WhereDownstreamResultEmpty_ReturnsFalse() { // arrange var proxy = new AuthenticatorProxyWithResult(""); authenticator = new Authenticator(proxy); // act var result = await authenticator.Authenticate("url"); Assert.IsFalse(result.IsSuccess); }
public async Task Authenticate_WhereDownstreamResultOccurs_ReturnsToken() { // arrange var proxy = new AuthenticatorProxyWithResult("foo"); authenticator = new Authenticator(proxy); // act var result = await authenticator.Authenticate("url"); Assert.AreEqual("foo", result.AccessToken); }
public async Task Authenticate_WhereDownstreamResultOccurs_ReturnsSuccess() { // arrange var proxy = new AuthenticatorProxyWithResult("foo"); authenticator = new Authenticator(proxy); // act var result = await authenticator.Authenticate("url"); Assert.IsTrue(result.IsSuccess); }