Exemplo n.º 1
0
        public void OnItemSelected_IsCalled_WhenItemSelected()
        {
            var state        = new AppState();
            var presentation = new MockUiPresentation();
            var sut          = new UiPresentationDriver(state, presentation);

            state.SelectItem(new ToDoItem("Test"));
            Assert.Equal(new String[] { "ItemSelected" }, presentation.StatesEncounted);
        }
Exemplo n.º 2
0
        public void OnAppLoadingStarted_IsCalled_WhenRunStateLoading()
        {
            var state        = new AppState();
            var presentation = new MockUiPresentation();
            var sut          = new UiPresentationDriver(state, presentation);

            state.RunState = RunState.Loading;
            Assert.Equal(new String[] { "AppLoadingStarted" }, presentation.StatesEncounted);
        }
Exemplo n.º 3
0
        public void OnAppLoadingComplete_IsCalled_WhenRunStateLoaded()
        {
            var state        = new AppState();
            var presentation = new MockUiPresentation();
            var sut          = new UiPresentationDriver(state, presentation);

            state.RunState = RunState.Loaded;
            Assert.Equal(new String[] { "AppLoadingComplete", "ItemSelectionCleared" }, presentation.StatesEncounted);
        }
Exemplo n.º 4
0
        public void CallsOnItemSelectionCleared_OnSelectedItemCleared()
        {
            var state        = new AppState();
            var presentation = new MockUiPresentation();
            var sut          = new UiPresentationDriver(state, presentation);

            state.SelectItem(new ToDoItem("Test"));
            state.SelectItem(null);
            Assert.Equal(new String[] { "ItemSelected", "ItemSelectionCleared" }, presentation.StatesEncounted);
        }
Exemplo n.º 5
0
        public App()
        {
            InitializeComponent();

            _appState           = new AppState();
            _uiPresentation     = ChoosePresentation();
            _presentationDriver = new UiPresentationDriver(_appState, _uiPresentation);

            // TODO: This should run async so loading screen isn't blocked
            _appState.RunState = RunState.Loading;
            RestoreState();
            _appState.RunState = RunState.Loaded;
        }