public void Initialize()
        {
            this._chamaController = Substitute.For <ChamaController>();
            this._chamaApi        = Substitute.For <ChamaApi>(this._urlParams);

            this._viewModel = new GroupSelectionViewModel(this._chamaController, this._chamaApi)
            {
                AllGroups = JsonConvert.DeserializeObject <List <Group> >(this._json)
            };

            this._viewModel.DisplayedGroups.Add(this._viewModel.AllGroups[0]);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GroupSelectionViewModel"/> class.
 /// </summary>
 /// <param name="controller">The database access controller</param>
 /// <param name="api">The api for fetching groups</param>
 public GroupSelectionViewModel(ChamaController controller, ChamaApi api)
 {
     this._chamaController = controller;
     this._chamaApi        = api;
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GroupSelectionViewModel"/> class.
 /// Note: This constructor is called by JsonConver.Deserialize. Do not remove it.
 /// </summary>
 public GroupSelectionViewModel()
 {
     this._chamaApi        = new ChamaApi("v1/chama/groups");
     this._chamaController = new ChamaController();
 }