Exemplo n.º 1
0
        public void Import_CancelGivesUnsuccessfulImport_CallsLogImportCanceledMessage()
        {
            //  Setup
            var importTarget   = new object();
            var simpleImporter = new SimpleFileImporter <object>(importTarget)
            {
                ImportSuccessful = false
            };

            simpleImporter.SetProgressChanged((description, step, steps) => simpleImporter.Cancel());

            // Call
            simpleImporter.Import();

            // Assert
            Assert.IsTrue(simpleImporter.LogCanceledMessageCalled);
        }
Exemplo n.º 2
0
        public void Import_ImportSuccessful_LogsImportSuccessfulMessage()
        {
            // Setup
            var importTarget   = new object();
            var simpleImporter = new SimpleFileImporter <object>(importTarget)
            {
                ImportSuccessful = true
            };

            // Call
            Action call = () => simpleImporter.Import();

            // Asset
            TestHelper.AssertLogMessageWithLevelIsGenerated(call, new Tuple <string, LogLevelConstant>(
                                                                $"Gegevens zijn geïmporteerd vanuit bestand '{string.Empty}'.",
                                                                LogLevelConstant.Info));
        }
Exemplo n.º 3
0
        public void Import_CancelGivesSuccessfulImport_LogsMessage()
        {
            //  Setup
            var importTarget   = new object();
            var simpleImporter = new SimpleFileImporter <object>(importTarget)
            {
                ImportSuccessful = true
            };

            simpleImporter.SetProgressChanged((description, step, steps) => simpleImporter.Cancel());

            // Call
            Action call = () => simpleImporter.Import();

            // Assert
            TestHelper.AssertLogMessageWithLevelIsGenerated(call, new Tuple <string, LogLevelConstant>(
                                                                "Huidige actie was niet meer te annuleren en is daarom voortgezet.",
                                                                LogLevelConstant.Warn));
        }