Esempio n. 1
0
        public void CreateNewProject_WithCreateAssessmentSectionFuncReturnNull_ReturnsNull()
        {
            // Setup
            var projectFactory = new RiskeerProjectFactory(() => null);

            // Call
            IProject project = projectFactory.CreateNewProject();

            // Assert
            Assert.IsNull(project);
        }
Esempio n. 2
0
        public void CreateNewProject_WithCreateAssessmentSectionFuncReturnAssessmentSection_ReturnsNewRiskeerProject()
        {
            // Setup
            var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike);
            var projectFactory    = new RiskeerProjectFactory(() => assessmentSection);

            // Call
            IProject project = projectFactory.CreateNewProject();

            // Assert
            Assert.IsInstanceOf <RiskeerProject>(project);
            var riskeerProject = (RiskeerProject)project;

            Assert.AreSame(assessmentSection, riskeerProject.AssessmentSection);
        }
Esempio n. 3
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            ParseArguments(e.Args);

            DeleteOldLogFiles();

            Resources.Add(SystemParameters.MenuPopupAnimationKey, PopupAnimation.None);

            var settings = new GuiCoreSettings
            {
                ApplicationName          = "Riskeer",
                ApplicationIcon          = ApplicationResources.Riskeer,
                SupportHeader            = ApplicationResources.SupportHeader,
                SupportText              = ApplicationResources.SupportText,
                SupportWebsiteAddressUrl = "https://iplo.nl/contact/",
                SupportPhoneNumber       = "088-7970790",
                ManualFilePath           = "Gebruikershandleiding Riskeer 22.1.1.pdf",
                MadeByBitmapImage        = new BitmapImage(new Uri($"{PackUriHelper.UriSchemePack}://application:,,,/Resources/MadeBy.png"))
            };

            var mainWindow      = new MainWindow();
            var projectMigrator = new ProjectMigrator(new DialogBasedInquiryHelper(mainWindow));
            var assessmentSectionFromFileHandler = new AssessmentSectionFromFileHandler(mainWindow);
            var projectFactory = new RiskeerProjectFactory(() => assessmentSectionFromFileHandler.GetAssessmentSectionFromFile());

            gui = new GuiCore(mainWindow, new StorageSqLite(), projectMigrator, projectFactory, settings)
            {
                Plugins =
                {
                    new RiskeerPlugin(),
                    new ClosingStructuresPlugin(),
                    new StabilityPointStructuresPlugin(),
                    new WaveImpactAsphaltCoverPlugin(),
                    new GrassCoverErosionInwardsPlugin(),
                    new GrassCoverErosionOutwardsPlugin(),
                    new PipingPlugin(),
                    new HeightStructuresPlugin(),
                    new StabilityStoneCoverPlugin(),
                    new DuneErosionPlugin(),
                    new MacroStabilityInwardsPlugin()
                }
            };

            RunRiskeer();
        }