Пример #1
0
            public TheDoneAction()
            {
                InteractorFactory
                .AreCustomColorsEnabledForWorkspace(DefaultWorkspaceId)
                .Execute()
                .Returns(Observable.Return(false));

                InteractorFactory
                .AreCustomColorsEnabledForWorkspace(proWorkspaceId)
                .Execute()
                .Returns(Observable.Return(true));

                InteractorFactory
                .GetDefaultWorkspace()
                .Execute()
                .Returns(Observable.Return(Workspace));

                InteractorFactory
                .GetWorkspaceById(Arg.Any <long>())
                .Execute()
                .Returns(Observable.Return(Workspace));

                InteractorFactory
                .CreateProject(Arg.Any <CreateProjectDTO>())
                .Execute()
                .Returns(Observable.Return(project));

                project.Id.Returns(projectId);
                Workspace.Id.Returns(proWorkspaceId);
            }
Пример #2
0
            public async Task DoesNotTrySavingTheChanges()
            {
                ViewModel.Prepare("Some name");

                await ViewModel.CloseCommand.ExecuteAsync();

                await InteractorFactory.CreateProject(Arg.Any <CreateProjectDTO>()).DidNotReceive().Execute();
            }
Пример #3
0
            public void DoesNotTrySavingTheChanges()
            {
                ViewModel.Prepare("Some name");

                ViewModel.Close.Execute();
                TestScheduler.Start();

                InteractorFactory.CreateProject(Arg.Any <CreateProjectDTO>()).DidNotReceive().Execute();
            }
Пример #4
0
                public void DoesNothingIfUserCancels()
                {
                    DialogService
                    .Confirm(
                        Arg.Is(Resources.WorkspaceChangedAlertTitle),
                        Arg.Is(Resources.WorkspaceChangedAlertMessage),
                        Arg.Is(Resources.Ok),
                        Arg.Is(Resources.Cancel))
                    .Returns(Observable.Return(false));

                    ViewModel.Save.Execute();
                    TestScheduler.Start();

                    InteractorFactory.CreateProject(Arg.Any <CreateProjectDTO>()).DidNotReceive().Execute();
                    NavigationService.DidNotReceive().Close(Arg.Is(ViewModel), Arg.Any <long>());
                }
Пример #5
0
                public async Task DoesNothingIfUserCancels()
                {
                    prepare();
                    DialogService
                    .Confirm(
                        Arg.Is(Resources.WorkspaceChangedAlertTitle),
                        Arg.Is(Resources.WorkspaceChangedAlertMessage),
                        Arg.Is(Resources.Ok),
                        Arg.Is(Resources.Cancel))
                    .Returns(Observable.Return(false));

                    await ViewModel.DoneCommand.ExecuteAsync();

                    await InteractorFactory.CreateProject(Arg.Any <CreateProjectDTO>()).DidNotReceive().Execute();

                    await NavigationService.DidNotReceive().Close(Arg.Is(ViewModel), Arg.Any <long>());
                }