Esempio n. 1
0
        public void FilesProcessing()
        {
            string[] fileNames = Directory.GetFiles(Constants.DataFilesFolder);

            var recordCollector = RecordCollector.GetInstance();

            foreach (var fileName in fileNames)
            {
                using (container = new UnityContainer())
                {
                    var menuConfiguration = new MenuConfiguration(container);
                    menuConfiguration.Configure();

                    var menu = container.Resolve <IMenu>();

                    var configurator = new ReportConfigurator(container, fileName, menu);

                    configurator.Setup();

                    if (configurator.IsSuccesfulConfiguration)
                    {
                        var record = new OfficerProcessingRecord();

                        record.FileName = fileName;

                        recordCollector.AddRecord(record);

                        Run();
                    }
                }
            }
            recordCollector.WriteRecordList();
        }
Esempio n. 2
0
        public void MenuConfiguration_ConstructorParameterContainerNotNullReturnsMenuConfiguration()
        {
            IUnityContainer fakeUnityContainer = new UnityContainer();

            var menuConfiguration = new MenuConfiguration(fakeUnityContainer);

            menuConfiguration.Configure();

            var isRegistered = fakeUnityContainer.IsRegistered <IMenu>();

            Assert.True(isRegistered);
        }