Exemplo n.º 1
0
        public void ClaimCase_CurrentCaseIsNotNullAndModelReturnsTrue_HideProgressDialogCalled()
        {
            var testCase = new Case
            {
                Id = 1
            };

            _fakeModel.GetCase(1).Returns(testCase);
            _uut.SetCurrentCase(1);
            _fakeModel.ClaimCase(1).Returns(true);

            _uut.ClaimCase().Wait();

            _fakeView.Received().HideProgressDialog();
        }
Exemplo n.º 2
0
        public async Task ClaimCase()
        {
            if (CurrentCase != null)
            {
                _view.ShowProgressDialog();
                bool result = await Task.Factory.StartNew(() => _model.ClaimCase(CurrentCase.Id));

                if (!result)
                {
                    _view.HideProgressDialog();
                    _view.CaseNotClaimed();
                }
                else
                {
                    _view.HideProgressDialog();
                    _view.CaseClaimed();
                }
            }
            else
            {
                _view.NoCurrentCase();
            }
        }