Esempio n. 1
0
 public StarKebabKing(IComponentsFactory _componentsFactory)
 {
     componentsFactory = _componentsFactory;
     name  = "Star Kebab King";
     dough = "Thin Dough";
     sauce = "Marinara Sauce";
     toppings.Add("Ham");
 }
Esempio n. 2
0
 public FastKebabSmall(IComponentsFactory _componentsFactory)
 {
     componentsFactory = _componentsFactory;
     name  = "Fast Kebab Small kebab";
     dough = "Thick Dough";
     sauce = "Plum Sauce";
     toppings.Add("Pickled Onion");
     toppings.Add("Tomato");
 }
Esempio n. 3
0
 public StarKebabHot(IComponentsFactory _componentsFactory)
 {
     componentsFactory = _componentsFactory;
     name  = "Star Kebab Hot";
     dough = "Thin Dough";
     sauce = "Bruschetta Sauce";
     toppings.Add("Reggiano cheese");
     toppings.Add("Garlic");
 }
Esempio n. 4
0
        public void Throw_ArgumentNullException_WhenFactoryIsNull()
        {
            //Assert
            var historyItemsListMock   = new Mock <IHistoryItemsCollection>();
            IComponentsFactory factory = null;
            //Act&&Assert
            var ex = Assert.ThrowsException <ArgumentNullException>(() => new HistoryEventWriter(historyItemsListMock.Object, factory));

            Assert.AreEqual(string.Format(CommandsConsts.NULL_OBJECT, nameof(factory)), ex.ParamName);
        }
 internal ImageOrganizerApplication(
     ICommandLineParser commandLineParser,
     IImageManipulatorsFactory imageManipulatorFactory,
     IComponentsFactory componentsFactory,
     ISystemContext systemContext)
 {
     this.commandLineParser       = commandLineParser;
     this.imageManipulatorFactory = imageManipulatorFactory;
     this.componentsFactory       = componentsFactory;
     this.systemContext           = systemContext;
 }
Esempio n. 6
0
        private void btnDisplaySpec_Click(object sender, EventArgs e)
        {
            if (rbGaming.Checked)
                componentsFactory = new GamingFactory();
            else if (rbBusiness.Checked)
                componentsFactory = new BusinessFactory();
            else if (rbMultimedia.Checked)
                componentsFactory = new MultimediaFactory();

            MachineSpecPrinter currentSpec = new MachineSpecPrinter(componentsFactory, rtbDisplay);
            currentSpec.print();
        }
 public CreatePersonCommand(IHistoryEventWriter historyEventWriter, IPersonsCollection personList, IComponentsFactory componentsFactory)
 {
     this.historyEventWriter = historyEventWriter ?? throw new ArgumentNullException(
                                         string.Format(
                                             CommandsConsts.NULL_OBJECT,
                                             nameof(historyEventWriter)));
     this.personList = personList ?? throw new ArgumentNullException(
                                 string.Format(
                                     CommandsConsts.NULL_OBJECT,
                                     nameof(personList)));
     this.componentsFactory = componentsFactory ?? throw new ArgumentNullException(
                                        string.Format(
                                            CommandsConsts.NULL_OBJECT,
                                            nameof(componentsFactory)));
 }
Esempio n. 8
0
 public MapReduceManager
 (
     string dataFilePath, int nMappers, int nReducers,
     BlockingCollection <TIn> blockingCollection,
     IComponentsFactory componentsFactory,
     IDataReader <TIn> dataReader
 )
 {
     _dataFilePath       = dataFilePath;
     _nMappers           = nMappers;
     _nReducers          = nReducers;
     _blockingCollection = blockingCollection;
     _componentsFactory  = componentsFactory;
     _dataReader         = dataReader;
 }
        public void AddsNewComponentCorrectly()
        {
            Random             rnd = new Random();
            string             randomComponentName           = BSManager.ComponentsNamesDict.Keys.ElementAt(rnd.Next(BSManager.ComponentsNamesDict.Keys.Count));
            IComponentsFactory correspondingComponentFactory = BSManager.ComponentsNamesDict[randomComponentName];
            Rectangle          componentRectangle            = new Rectangle(rnd.Next(), rnd.Next(), rnd.Next(), rnd.Next());
            BSBaseComponent    expectedComp = correspondingComponentFactory.NewComponent(componentRectangle);

            BSManager.AddComponentWithNameAndRectangle(randomComponentName, componentRectangle);
            IList <BSBaseComponent> actualCompsList = BSManager.Components;

            Assert.AreEqual(1, actualCompsList.Count);
            BSBaseComponent actualComp = actualCompsList.First();

            Assert.AreEqual(expectedComp.GetType(), actualComp.GetType());
            Assert.AreEqual(componentRectangle, actualComp.OnScreenRectangle);
        }
Esempio n. 10
0
        public static IComponentsFactory CreateComponentsFactory(string sourceTitle)
        {
            if (sourceTitle == null)
            {
                throw new ArgumentNullException(nameof(sourceTitle));
            }

            IComponentsFactory componentsFactory = null;

            switch (sourceTitle)
            {
            case "belta.by": componentsFactory = new BeltaComponentsFactory(); break;

            case "bbc.com": componentsFactory = new BBCComponentFactory(); break;
            }

            return(componentsFactory);
        }
Esempio n. 11
0
        private void btnDisplaySpec_Click(object sender, EventArgs e)
        {
            if (rbGaming.Checked)
            {
                componentsFactory = new GamingFactory();
            }
            else if (rbBusiness.Checked)
            {
                componentsFactory = new BusinessFactory();
            }
            else if (rbMultimedia.Checked)
            {
                componentsFactory = new MultimediaFactory();
            }

            MachineSpecPrinter currentSpec = new MachineSpecPrinter(componentsFactory, rtbDisplay);

            currentSpec.print();
        }
Esempio n. 12
0
 public FakeHistoryEventWriter(IHistoryItemsCollection historyItemsList, IComponentsFactory factory) : base(historyItemsList, factory)
 {
 }
Esempio n. 13
0
 public CreateTeamCommand(IHistoryEventWriter historyEventWriter, IWIMTeams wimTeams, IComponentsFactory componentsFactory)
 {
     this.historyEventWriter = historyEventWriter ?? throw new ArgumentNullException(nameof(historyEventWriter));
     this.wimTeams           = wimTeams ?? throw new ArgumentNullException(nameof(wimTeams));
     this.componentsFactory  = componentsFactory ?? throw new ArgumentNullException(nameof(componentsFactory));
 }
Esempio n. 14
0
 public WebFolderToCsFilesConverter(IComponentsFactory factory, IHtmlsFinder finder)
 {
     _finder  = finder;
     _factory = factory;
 }
 public MachineSpecPrinter(IComponentsFactory componentsFactory, RichTextBox displayBox)
 {
     this.componentsFactory = componentsFactory;
     this.displayBox = displayBox;
 }
 public CreateBugCommand(IHistoryEventWriter historyEventWriter, IComponentsFactory componentsFactory, IGetters getter)
 {
     this.historyEventWriter = historyEventWriter ?? throw new ArgumentNullException(nameof(historyEventWriter));
     this.componentsFactory  = componentsFactory ?? throw new ArgumentNullException(nameof(componentsFactory));
     this.getter             = getter ?? throw new ArgumentNullException(nameof(getter));
 }
Esempio n. 17
0
 public ImageSorter(IComponentsFactory componentsFactory, ISystemContext systemContext)
 {
     this.componentsFactory = componentsFactory;
     this.systemContext     = systemContext;
     this.OnMessageSent(new MessageSentEventArgs(Resources.Info_ImageSorterInitialized, MessageType.Information));
 }
 public CommandParser(IComponentsFactory factory)
 {
     this.factory = factory;
 }
Esempio n. 19
0
 public MachineSpecPrinter(IComponentsFactory componentsFactory, RichTextBox displayBox)
 {
     this.componentsFactory = componentsFactory;
     this.displayBox        = displayBox;
 }
Esempio n. 20
0
 public HistoryEventWriter(IHistoryItemsCollection historyItemsList, IComponentsFactory factory)
 {
     this.historyItemsList = historyItemsList ?? throw new ArgumentNullException(string.Format(CommandsConsts.NULL_OBJECT, nameof(historyItemsList)));
     this.factory          = factory ?? throw new ArgumentNullException(string.Format(CommandsConsts.NULL_OBJECT, nameof(factory)));
 }
 public IImageDirectoryMerger CreateImageDirectoryMerger(
     IComponentsFactory componentsFactory,
     ISystemContext systemContext)
 {
     return((IImageDirectoryMerger) new ImageDirectoryMerger(componentsFactory, systemContext));
 }
Esempio n. 22
0
		public ScanCommand(IComponentsFactory[] factories)
		{
			_factories = factories;
		}