public void SetupTest()
        {
            for (int i = 0; i < 3; i++)
            {
                Employee p = new Employee();
                p.Name = i.ToString();
                res.Add(p);
            }

            this.editPositionCommandUnderTest = new EditPositionCommand();
            this.editPositionCommandUnderTest.CanExecuteChanged += (object sender, EventArgs e) => { Console.WriteLine("CanExecuteChanged"); };

            ClientProxy.Instance = Substitute.For <IHiringCompany>();
            ClientProxy.Instance.GetAllEmployees().Returns(new List <Employee>()
            {
                new Employee()
                {
                }
            });
            ClientProxy.Instance.GetAllNotSignedInEmployees().Returns(new List <Employee>()
            {
                new Employee()
                {
                }
            });
            ClientDialogViewModel.Instance = Substitute.For <IClientDialogViewModel>();
        }
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;
        }
 /// <summary>
 /// private constructor
 /// </summary>
 public ClientDialogViewModel()
 {
     this.ViewProjectsCommand           = new ViewProjectsCommand();
     this.AddEmployeeCommand            = new AddEmployeeCommand();
     this.ChangePasswordCommand         = new ChangePasswordCommand();
     this.EditPersonalDataCommand       = new EditPersonalDataCommand();
     this.SendRequestCompanyViewCommand = new SendRequestCompanyViewCommand();
     this.ViewWorkersCommand            = new ViewWorkersCommand();
     this.WorkingHoursCommand           = new WorkingHoursCommand();
     this.LogOutCommand                 = new LogOutCommand();
     this.SignInCommand                 = new SignInCommand();
     this.DefineUserStoriesCommand      = new DefineUserStoriesCommand();
     this.CreateProjectCommand          = new CreateProjectCommand();
     this.ShowCompaniesCommand          = new ShowCompaniesCommand();
     this.SendRequestProjectViewCommand = new SendRequestProjectViewCommand();
     this.LoadedCommand                 = new LoadedCommand();
     this.ErrorMessage               = "";
     this.LogInUser                  = new LogInUser();
     this.EditPositionCommand        = new EditPositionCommand();
     this.MarkProjectFinishedCommand = new MarkProjectFinishedCommand();
 }
Ejemplo n.º 4
0
 public void SetUp()
 {
     editPositionViewModelUnderTest = new EditPositionViewModel();
     editPositionCommandUnderTest   = new EditPositionCommand();
 }