// Config testing method requires internet and actually the knauf lookbook server public async Task configEqualsCheck() { string collectionIdentifier = "lookbook"; AuthenticationHeaderValue authorizationHeader = await TokenAuthorization.GetAuthHeaderValue("*****@*****.**", "Jdt9y9qHt3", "https://lookbook-dev.anfema.com/client/v1/login"); IonConfig config = new IonConfig("https://lookbook-dev.anfema.com/client/v1/", "de_DE", collectionIdentifier, "default", authorizationHeader, 120, 100, false); string collectionIdentifier2 = "lookbook"; AuthenticationHeaderValue authorizationHeader2 = await TokenAuthorization.GetAuthHeaderValue("*****@*****.**", "Jdt9y9qHt3", "https://lookbook-dev.anfema.com/client/v1/login"); IonConfig config2 = new IonConfig("https://lookbook-dev.anfema.com/client/v1/", "de_DE", collectionIdentifier2, "default", authorizationHeader2, 120, 100, false); Assert.IsTrue(config2.Equals(config)); }
public async Task <IonConfig> loginAsync() { if (!_loggedIn) { String collectionIdentifier = "lookbook"; AuthenticationHeaderValue authorizationHeader = await TokenAuthorization.GetAuthHeaderValue("*****@*****.**", "Jdt9y9qHt3", "https://lookbook-dev.anfema.com/client/v1/login"); // Or using BasicAuth //AuthenticationHeaderValue authorizationHeader = BasicAuth.GetAuthHeaderValue( "*****@*****.**", "Jdt9y9qHt3" ); IonConfig config = new IonConfig("https://lookbook-dev.anfema.com/client/v1/", "de_DE", collectionIdentifier, "default", authorizationHeader, 120, 100, false); // Only testing purpose TODO: remove _ampConfig = config; // Set the loggedIn bool _loggedIn = authorizationHeader != null; return(config); } return(_ampConfig); }