private string GetFromHttp() { var login = new Login(); var url = login.Url + ServiceConstants.MOBILE_SERVICES_RELATIVE_PATH + ServiceConstants.BUILD_STATUS_SERVICE_URL + "?apiKey=" + login.Key; return downloader.DownloadString(url); }
public void SetUp() { fakePersistenceService = new FakePersistenceService(); SmeedeeApp.Instance.ServiceLocator.Bind<IPersistenceService>(fakePersistenceService); SmeedeeApp.Instance.ServiceLocator.Bind<IValidationService>(new FakeValidationService()); SmeedeeApp.Instance.ServiceLocator.Bind<ILog>(new FakeLogService()); login = new Login(); }
public AppDelegateShared(UIWindow window, UITabBarController tabBarController, UIViewController loginController) { this.window = window; this.tabBarController = tabBarController; this.loginHeaderController = loginHeaderController; this.loginController = loginController; login = new Login(); previousWasServerConfig = false; }
private string GetDataFromHttp(TimePeriod time) { var login = new Login(); var url = login.Url + ServiceConstants.MOBILE_SERVICES_RELATIVE_PATH + ServiceConstants.TOP_COMMITTERS_SERVICE_URL + "?days=" + (int)time + "&apiKey=" + login.Key; return http.DownloadString(url); }
public string GetFromHttp(int revision) { var login = new Login(); var parameter = (revision == -1 ? "" : "&revision=" + revision); var url = login.Url + ServiceConstants.MOBILE_SERVICES_RELATIVE_PATH + ServiceConstants.LATEST_COMMITS_SERVICE_URL + "?apiKey=" + login.Key+ parameter; return downloader.DownloadString(url); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.StartUpLoadingScreen); var login = new Login(); if (login.Url == "" && login.Key == "") { login.Url = Login.DefaultSmeedeeUrl; login.Key = Login.DefaultSmeedeeKey; } login.IsValid(valid => { var nextActivity = valid ? typeof(WidgetContainer) : typeof(LoginScreen); StartActivity(new Intent(this, nextActivity)); Finish(); }); }
private void BindDependencies() { var app = SmeedeeApp.Instance; app.ServiceLocator.Bind<ILog>(new NoLog()); app.ServiceLocator.Bind<IBackgroundWorker>(new BackgroundWorker()); app.ServiceLocator.Bind<Directories>(new Directories() { CacheDir = "" }); //We cache in the root of our IsolatedStorage, so we have an empty string here app.ServiceLocator.Bind<IFileIO>(new Wp7FileIO()); app.ServiceLocator.Bind<IFetchHttp>(new HttpFetcher()); if (!USE_FAKES) { app.ServiceLocator.Bind<IPersistenceService>(new WpPersister()); app.ServiceLocator.Bind<IValidationService>(new ValidationService()); app.ServiceLocator.Bind<IImageService>(new MemoryCachedImageService(new ImageService())); app.ServiceLocator.Bind<IBuildStatusService>(new BuildStatusService()); app.ServiceLocator.Bind<ILatestCommitsService>(new LatestCommitsService()); app.ServiceLocator.Bind<IWorkingDaysLeftService>(new WorkingDaysLeftService()); app.ServiceLocator.Bind<ITopCommittersService>(new TopCommittersService()); } else { app.ServiceLocator.Bind<IPersistenceService>(new FakePersister()); app.ServiceLocator.Bind<IValidationService>(new FakeValidationService()); app.ServiceLocator.Bind<IImageService>(new MemoryCachedImageService(new ImageService())); //app.ServiceLocator.Bind<IImageService>(new MemoryCachedImageService(new DiskCachedImageService(new ImageService()))); app.ServiceLocator.Bind<IBuildStatusService>(new FakeBuildStatusService()); app.ServiceLocator.Bind<ILatestCommitsService>(new FakeLatestCommitsService()); app.ServiceLocator.Bind<IWorkingDaysLeftService>(new FakeWorkingDaysLeftService()); app.ServiceLocator.Bind<ITopCommittersService>(new FakeTopCommittersService()); } var login = new Login(); if (login.Key != "" || login.Url != "") return; login.Key = "o8rzdNQn"; login.Url = "http://services.smeedee.org/smeedee/"; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.LoginScreen); var submitButton = FindViewById<Button>(Resource.Id.BtnLogin); var urlInput = FindViewById<EditText>(Resource.Id.LoginScreenServerUrlInput); var keyInput = FindViewById<EditText>(Resource.Id.LoginScreenUserKeyInput); var login = new Login(); urlInput.Text = login.Url; keyInput.Text = login.Key; submitButton.Click += delegate { var dialog = ProgressDialog.Show(this, "", "Connecting to server and validating key...", true); var handler = new ProgressHandler(dialog); new Login().ValidateAndStore(urlInput.Text, keyInput.Text, (valid) => RunOnUiThread(() => { if (valid == Login.ValidationSuccess) { dialog.SetMessage("Successfully connected to " + urlInput.Text); var widgetContainer = new Intent(this, typeof(WidgetContainer)); StartActivity(widgetContainer); Finish(); handler.SendEmptyMessage(0); } else { dialog.SetMessage("Connection failed. Please try again"); handler.SendEmptyMessage(0); NotifyInvalidInput(); } })); }; }
public LoginViewModel() { _login = new Login(); }
public void Should_ask_http_downloader_to_download_from_the_correct_url() { var login = new Login(); login.Url = "http://services.smeedee.org/smeedee/"; login.Key = "key123"; downloader.SetHtmlString(""); service.Load(r => { }); Assert.AreEqual("http://services.smeedee.org/smeedee/MobileServices/BuildStatus/?apiKey=key123", downloader.UrlAskedFor); }
public ServerConfigTableSource(ServerConfigTableViewController controller) : base() { this.controller = controller; loginModel = new Login(); }