protected async Task <string> GetAuthTokenAsync() { var configurationValues = new TheTvDbConfigurationValuesV4(new TestConfigurationValues()); var localPaths = new TestLocalPaths(); var apiDownloader = CreateDownloader(); var authenticator = new TheTvDbAuthenticatorV4(new RealTimeDateProvider(), configurationValues, localPaths, apiDownloader); return(await authenticator.GetAuthTokenAsync(null)); }
public async Task AuthenticatorShouldRetrieveAndReturnToken() { // Arrange var configurationValues = new TheTvDbConfigurationValuesV4(new TestConfigurationValues()); var localPaths = new TestLocalPaths(); var apiDownloader = new TheTvDbApiDownloaderV4(configurationValues, new HttpDownloader()); var sut = new TheTvDbAuthenticatorV4(new RealTimeDateProvider(), configurationValues, localPaths, apiDownloader); // Act var actual = await sut.GetAuthTokenAsync(null); // Assert Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.Not.Empty); Console.WriteLine(actual); }