Esempio n. 1
0
 private ModelFactory()
 {
     _tcApi               = new TCApi();
     _logInModel          = new LogInModel(_tcApi);
     _homeModel           = new HomeModel(_tcApi);
     _userPreference      = new UserPreference(_tcApi);
     _settingsModel       = new SettingsModel();
     _createUserModel     = new CreateUserModel(_tcApi);
     _createCaseModel     = new CreateCaseModel(_tcApi);
     _caseModel           = new CaseModel(_tcApi);
     _changePasswordModel = new ChangePasswordModel(_tcApi);
     _mapModel            = new MapModel(_tcApi);
     _trafficLightModel   = new TrafficLightOverviewModel(_tcApi);
 }
Esempio n. 2
0
        public void Init()
        {
            _fakeView  = Substitute.For <ICreateCaseView>();
            _fakeModel = Substitute.For <ICreateCaseModel>();

            _installations = new List <Installation>
            {
                new Installation()
                {
                    Id       = 1,
                    Name     = "First",
                    Position = new Position()
                    {
                        Id         = 1,
                        Latitude   = 10.1,
                        Longtitude = 50.2
                    },
                    Status = 0
                },
                new Installation()
                {
                    Id       = 2,
                    Name     = "Second",
                    Position = new Position()
                    {
                        Id         = 2,
                        Latitude   = 20.1,
                        Longtitude = 60.2
                    },
                    Status = 1
                },
                new Installation()
                {
                    Id       = 3,
                    Name     = "Third",
                    Position = new Position()
                    {
                        Id         = 3,
                        Latitude   = 30.1,
                        Longtitude = 70.2
                    },
                    Status = 2
                }
            };

            _fakeModel.Installations.Returns(_installations.ToDictionary(i => i.Name, i => i.Id));

            _uut = new CreateCasePresenter(_fakeView, _fakeModel);
        }
Esempio n. 3
0
 public CreateCasePresenter(ICreateCaseView view, ICreateCaseModel model)
 {
     _view  = view;
     _model = model;
     _model.FetchData();
 }