Ejemplo n.º 1
0
 public void SetUp()
 {
     editPersonalDataViewModelUnderTest = new EditPersonalDataViewModel();
     editPositionCommandUnderTest       = new EditPersonalDataCommand();
     string username = editPersonalDataViewModelUnderTest.Username;
     string name     = editPersonalDataViewModelUnderTest.Name;
     string surname  = editPersonalDataViewModelUnderTest.Surname;
 }
Ejemplo n.º 2
0
        public void OneSetUp()
        {
            viewProjectsCommand           = new ViewProjectsCommand();
            addEmployeeCommand            = new AddEmployeeCommand();
            changePasswordCommand         = new ChangePasswordCommand();
            editPersonalDataCommand       = new EditPersonalDataCommand();
            sendRequestCompanyViewCommand = new SendRequestCompanyViewCommand();
            viewWorkersCommand            = new ViewWorkersCommand();
            workingHoursCommand           = new WorkingHoursCommand();
            logOutCommand                  = new LogOutCommand();
            signInCommand                  = new SignInCommand();
            defineUserStoriesCommand       = new DefineUserStoriesCommand();
            createProjectCommand           = new CreateProjectCommand();
            showCompaniesCommand           = new ShowCompaniesCommand();
            sendRequestProjectViewCommand  = new SendRequestProjectViewCommand();
            markProjectFinishedCommand     = new MarkProjectFinishedCommand();
            loadedCommand                  = new LoadedCommand();
            editPositionCommand            = new EditPositionCommand();
            clientDialogViewModelUnderTest = new ClientDialogViewModel();

            clientDialogViewModelUnderTest.AddEmployeeCommand       = addEmployeeCommand;
            clientDialogViewModelUnderTest.ChangePasswordCommand    = changePasswordCommand;
            clientDialogViewModelUnderTest.CreateProjectCommand     = createProjectCommand;
            clientDialogViewModelUnderTest.DefineUserStoriesCommand = defineUserStoriesCommand;
            clientDialogViewModelUnderTest.EditPersonalDataCommand  = editPersonalDataCommand;
            clientDialogViewModelUnderTest.EditPositionCommand      = editPositionCommand;
            clientDialogViewModelUnderTest.ErrorMessage             = "";
            clientDialogViewModelUnderTest.LoadedCommand            = loadedCommand;
            clientDialogViewModelUnderTest.LogInUser     = new LogInUser();
            clientDialogViewModelUnderTest.LogOutCommand = logOutCommand;
            clientDialogViewModelUnderTest.MarkProjectFinishedCommand    = markProjectFinishedCommand;
            clientDialogViewModelUnderTest.SendRequestCompanyViewCommand = sendRequestCompanyViewCommand;
            clientDialogViewModelUnderTest.SendRequestProjectViewCommand = sendRequestProjectViewCommand;
            clientDialogViewModelUnderTest.ShowCompaniesCommand          = showCompaniesCommand;
            clientDialogViewModelUnderTest.SignInCommand       = signInCommand;
            clientDialogViewModelUnderTest.ViewProjectsCommand = viewProjectsCommand;
            clientDialogViewModelUnderTest.ViewWorkersCommand  = viewWorkersCommand;
            clientDialogViewModelUnderTest.Resources           = new ObservableCollection <Employee>();
            clientDialogViewModelUnderTest.PrResources         = new ObservableCollection <Project>();
            clientDialogViewModelUnderTest.EmpResource         = new ObservableCollection <Employee>();
            clientDialogViewModelUnderTest.OcResources         = new ObservableCollection <OutsourcingCompany>();
            clientDialogViewModelUnderTest.UsResources         = new ObservableCollection <UserStory>();


            LogInUser nov = clientDialogViewModelUnderTest.LogInUser;
            string    str = clientDialogViewModelUnderTest.ErrorMessage;
            ObservableCollection <Employee>           res1 = clientDialogViewModelUnderTest.Resources;
            ObservableCollection <Project>            res2 = clientDialogViewModelUnderTest.PrResources;
            ObservableCollection <Employee>           res3 = clientDialogViewModelUnderTest.EmpResource;
            ObservableCollection <OutsourcingCompany> res4 = clientDialogViewModelUnderTest.OcResources;
            ObservableCollection <UserStory>          res5 = clientDialogViewModelUnderTest.UsResources;
        }
        public void SetupTest()
        {
            this.editPersonalDataCommandUnderTest = new EditPersonalDataCommand();
            this.editPersonalDataCommandUnderTest.CanExecuteChanged += (object sender, EventArgs e) => { Console.WriteLine("CanExecuteChanged"); };
            ClientDialogViewModel.Instance = Substitute.For <IClientDialogViewModel>();
            ClientDialogViewModel.Instance.LogInUser().Returns(new LogInUser()
            {
                Username = username, Password = password
            });

            ClientProxy.Instance = Substitute.For <IHiringCompany>();
            ClientProxy.Instance.GetEmployee("", "").ReturnsForAnyArgs(new Employee());

            EditPersonalDataViewModel.Instance = Substitute.For <IEditPersonalDataViewModel>();
            EditPersonalDataViewModel.Instance.Name("");
            EditPersonalDataViewModel.Instance.Surname("");
            EditPersonalDataViewModel.Instance.Username("");

            ClientDialogViewModel.Instance.ShowEditPersonalDataView();
        }