Beispiel #1
0
        public void SelectedProject_NewViewModel_SelectedProjectIsCorrect(int workshiftPkId, string projectName)
        {
            // Arrange
            App.GenerateTestData().Wait();
            var workshiftRepository = new WorkshiftRepository();
            var workshift           = workshiftRepository.GetItemAsync(workshiftPkId).Result;

            // Act
            viewModel = new AddWorkshiftViewModel(workshift);

            // Assert
            Assert.Equal(projectName, viewModel.SelectedProject?.Name);
        }
Beispiel #2
0
        public void SetProjectOfWorkshift_NewViewModel_ProjectIsSet(int projectId)
        {
            // Arrange
            App.GenerateTestData().Wait();
            var workshiftRepository = new WorkshiftRepository();
            var projectRepository   = new ProjectRepository();
            var workshift           = workshiftRepository.GetItemAsync(1).Result;

            viewModel = new AddWorkshiftViewModel(workshift);
            var project = projectRepository.GetItemAsync(projectId).Result;

            // Act
            viewModel.SetProjectOfWorkshift(project);

            // Assert
            Assert.Equal(projectId, viewModel.Item.ProjectId);
        }