public void OnCmdSpeichern()
        {
            if (!HasRequiredFields())
            {
                return;
            }

            if (!_documentManagementService.AddNewDocument(_benutzer, _bezeichnung, _erfassungsdatum, _filePath, _selectedTypItem, _stichwoerter, Convert.ToDateTime(_valutaDatum), _isRemoveFileEnabled))
            {
                return;
            }

            _navigateBack();
        }
Ejemplo n.º 2
0
        public void AddNewDocument_RemoveFileFails_True() //True --> Da Messagebox informiert, dass File nicht gelöscht werden konnte
        {
            // arrange
            var messegaBoxService = new MessageBoxServiceForTesting();
            var importService     = new ImportServiceForTesting(true);
            var exportService     = new ExportServiceForTesting(true);
            var fileService       = new FileServiceForTesting(false, true, true, true);
            var searchService     = new SearchServiceForTesting(true, true, true);
            var itemlist          = new List <MetadataItem>();
            var DMS = new DocumentManagementService(itemlist, messegaBoxService, importService, exportService, fileService, searchService);

            // act
            var result = DMS.AddNewDocument("Username", "Dokumenten Bezeichnung", DateTime.Parse("01.01.2020 19:00:00"), "C:\\Temp", "Verträge", "Notiz",
                                            DateTime.Parse("30.06.2020 00:00:00"), true);

            // assert
            Assert.That(result, Is.EqualTo(true));
        }
Ejemplo n.º 3
0
        public void AddNewDocument_MoveFileToRepositoryFails_False()
        {
            // arrange
            var messegaBoxService = new MessageBoxServiceForTesting();
            var importService     = new ImportServiceForTesting(true);
            var exportService     = new ExportServiceForTesting(true);
            var fileService       = new FileServiceForTesting(true, false, true, true);
            var searchService     = new SearchServiceForTesting(true, true, true);
            var itemlist          = new List <MetadataItem>();
            var DMS = new DocumentManagementService(itemlist, messegaBoxService, importService, exportService, fileService, searchService);

            // act
            var result = DMS.AddNewDocument("Username", "Dokumenten Bezeichnung", DateTime.Parse("01.01.2020 19:00:00"), "C:\\Temp", "Verträge", "Notiz",
                                            DateTime.Parse("30.06.2020 00:00:00"), false);

            // assert
            Assert.That(result, Is.EqualTo(false));
        }