public TopCommittersConfigTableSource(UITableViewController controller)
     : base(SmeedeeApp.Instance.AvailableWidgets.Where(e => e.SettingsType == typeof(TopCommittersConfigTableViewController)).First())
 {
     this.controller = controller;
     model           = new TopCommitters();
     countSelected   = countValues.IndexOf(model.NumberOfCommitters);
     timeSelected    = timeValues.IndexOf(model.TimePeriod);
 }
Ejemplo n.º 2
0
        public void SetUp()
        {
            var serviceLocator = SmeedeeApp.Instance.ServiceLocator;

            persistenceService   = new FakePersistenceService();
            topCommittersService = new TopCommittersFakeService();

            serviceLocator.Bind <IPersistenceService>(persistenceService);
            serviceLocator.Bind <ITopCommittersService>(topCommittersService);

            _model = new TopCommitters();
        }
Ejemplo n.º 3
0
        public void Should_get_different_results_for_different_time_periods()
        {
            var model1 = new TopCommitters();

            model1.TimePeriod = TimePeriod.PastDay;
            model1.Load(() => { });
            var list1 = model1.Committers;

            model1.TimePeriod = TimePeriod.PastWeek;
            model1.Load(() => { });
            var list2 = model1.Committers;

            CollectionAssert.AreNotEqual(list1, list2);
        }
Ejemplo n.º 4
0
        public void Should_be_able_to_fetch_and_parse_service_when_server_is_running_on_localhost()
        {
            var persistance = new FakePersistenceService();

            SmeedeeApp.Instance.ServiceLocator.Bind <IPersistenceService>(persistance);
            SmeedeeApp.Instance.ServiceLocator.Bind <IBackgroundWorker>(new NoBackgroundInvocation());
            SmeedeeApp.Instance.ServiceLocator.Bind <ITopCommittersService>(new TopCommittersService());
            persistance.Save("Login_Url", "http://localhost:1155/Smeedee");

            var model = new TopCommitters();

            model.Load(() => { });
            Assert.AreNotEqual(0, model.Committers.Count());
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var tableSource = new TopCommitersTableSource();

            TableView.Source = tableSource;

            topCommitters = service.GetSingle(new Dictionary <string, string>());
            InvokeOnMainThread(() => {
                tableSource.Committers = topCommitters.Committers;
                TableView.ReloadData();
            });
        }
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     AddPreferencesFromResource(Resource.Layout.TopCommittersSettings);
     _model = new TopCommitters();
 }
        public TopCommittersViewModel()

        {
            model = new TopCommitters();
            Items = new ObservableCollection <TopCommittersItemViewModel>();
        }
Ejemplo n.º 8
0
 public TopCommittersWidget(Context context) : base(context)
 {
     InflateView();
     _model = new TopCommitters();
     Refresh();
 }
Ejemplo n.º 9
0
 public void SetModel(TopCommitters model)
 {
     _model = model;
 }
 public TopCommittersWidget() : base("TopCommittersWidget", null)
 {
     model = new TopCommitters();
 }