Exemple #1
0
        public MainPageViewModel()
        {
            _connectionStringManager = new ConnectionStringManager();
            _importer         = new RecordImporter(FileName, UpdateView);
            _connectionString = _connectionStringManager.ReadConnectionString("ConnectionString");

            ValidateDelegate += Validate;

            CheckProvider();
        }
        public void RecordImporter_Factory( )
        {
            IReaderToEntityAdapter adapter  = new Mock <IReaderToEntityAdapter>( ).Object;
            IImportReporter        reporter = new Mock <IImportReporter>().Object;
            ApiResourceMapping     mapping  = new ApiResourceMapping( );

            RecordImporter.Factory recordImporterFactory = Factory.Current.Resolve <RecordImporter.Factory>( );
            IRecordImporter        recordImporter        = recordImporterFactory(adapter, reporter, mapping, true);

            Assert.That(recordImporter, Is.TypeOf <RecordImporter>( ));

            RecordImporter importer = (RecordImporter)recordImporter;

            Assert.That(importer.ReaderToEntityAdapter, Is.EqualTo(adapter));
            Assert.That(importer.Reporter, Is.EqualTo(reporter));
        }