public override void RunApp() { _writter = new ConsoleWritter(); var cells = new AbstractCell[10, 10]; for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { if (i + j%2 == 0) { cells[i, j] = new ProxyMine(i, j); } else { cells[i, j] = new EmptyProxy(i, j); } } } //Open for (var i = 0; i < 10; i++) { for (var j = 0; j < 10; j++) { //this case will be run after cells start drawing cells[i, j].Open(); } } }
public override void RunApp() { _output = new ConsoleWritter(); var task1 = new Task(true, "first task", DateTime.Now, DateTime.MaxValue); var task2 = new Task(false, "Second task", DateTime.Now, DateTime.Now.Add(new TimeSpan(0, 15, 0))); var list = new ListTask(new List<Task>()); list.AddTask(task1); list.AddTask(task2); _output.WriteLine("List task///"); var iteratorlist = list.GetIterator(); while (iteratorlist.HasNext()) { _output.WriteLine(iteratorlist.Next().ToString()); } _output.WriteLine("Array task///"); var task = new ArrayTask(new[]{task1,task2}, 0); iteratorlist = task.ArrayIterator(); while (iteratorlist.HasNext()) { _output.WriteLine(iteratorlist.Next().ToString()); } }
public AddPhoneCommand( IOutputWritter outputWritter, ICanonicalPhoneConverter canonicalPhoneConverter, IPhonebookRepository phonebook) : base(outputWritter, canonicalPhoneConverter, phonebook) { }
static void Main(string[] args) { IKernel _kernel = new StandardKernel(); _kernel.Load(Assembly.GetExecutingAssembly()); ICSVRepository <IPerson, IFrequency, IAddress> _repo = _kernel.Get <ICSVRepository <IPerson, IFrequency, IAddress> >(); IOutputWritter _writter = _kernel.Get <IOutputWritter>(); var frequencies = _repo.GetNameFrequency(); var sortedAddresses = _repo.GetSortedAddresses(); StringBuilder sbfr = new StringBuilder(); StringBuilder sbsort = new StringBuilder(); foreach (var fr in frequencies) { sbfr.AppendLine(String.Format("{0},{1}", fr.Value, fr.Count)); } foreach (var adr in sortedAddresses) { sbsort.AppendLine(String.Format("{0}", adr.FullAddress)); } ShowNameFrequency(frequencies); ShowSortedAddresses(sortedAddresses); _writter.WriteToOutPutFile(sbfr); _writter.WriteToOutPutFile(sbsort); Console.WriteLine("Opening Output Folder"); Console.WriteLine("Press any key to exit and open the Output Folder...."); Console.ReadKey(); _writter.OpenLogDirectory(); }
public TransactionsFeeDataGenerator(ITransactionData transactionData, IDataGenerator dataGenerator, IFeeCalculator feeCalculator, IOutputWritter outputWritter) { _transactionData = transactionData; _dataGenerator = dataGenerator; _feeCalculator = feeCalculator; _consoleWritter = outputWritter; }
public Letter(IOutputWritter writter, string @from, string to) : base(writter) { _writter = writter; To = to; From = @from; }
public void WriteToOutPutFileTest() { IKernel _kernel = new StandardKernel(); _kernel.Load(Assembly.GetExecutingAssembly()); ICSVRepository <IPerson, IFrequency, IAddress> _repo = _kernel.Get <ICSVRepository <IPerson, IFrequency, IAddress> >(); IOutputWritter _writter = _kernel.Get <IOutputWritter>(); var frequencies = _repo.GetNameFrequency(); var sortedAddresses = _repo.GetSortedAddresses(); StringBuilder sbfr = new StringBuilder(); StringBuilder sbsort = new StringBuilder(); foreach (var fr in frequencies) { sbfr.AppendLine(String.Format("{0},{1}", fr.Value, fr.Count)); } foreach (var adr in sortedAddresses) { sbsort.AppendLine(String.Format("{0}", adr.FullAddress)); } _writter.WriteToOutPutFile(sbfr); _writter.WriteToOutPutFile(sbsort); Assert.IsTrue(Directory.GetFiles(Environment.CurrentDirectory + @"\Output", "Output*.csv").Length == 2); }
public Task(string @do, string name, IOutputWritter writter) { Name = name; _writter = writter; Do = @do; _behavior = new List<AbstractBehavior>(); }
public Email(IOutputWritter writter, string to, string @from, string theme) : base(writter) { _writter = writter; Theme = theme; From = @from; To = to; }
public CommandFactory( IOutputWritter outputWritter, ICanonicalPhoneConverter canonicalPhoneConverter, IPhonebookRepository phonebook) { this.canonicalPhoneConverter = canonicalPhoneConverter; this.outputWritter = outputWritter; this.phonebookRepository = phonebook; }
protected BasePhoneCommand( IOutputWritter outputWritter, ICanonicalPhoneConverter canonicalPhoneConverter, IPhonebookRepository phonebook) { this.CanonicalPhoneConverter = canonicalPhoneConverter; this.OutputWritter = outputWritter; this.PhonebookRepository = phonebook; }
public LettersReader(IOutputWritter writter) { if (writter == null) { throw new ArgumentNullException(nameof(writter)); } this.writter = writter; }
public PhonebookManager( string defaultCountryCode, IOutputWritter resultReporter, ICommandExecutor commandExecutor) { this.defaultCountryCode = defaultCountryCode; this.resultReporter = resultReporter; this.commandExecutor = commandExecutor; }
public Engine(IBuildingFactory buildingFactory, IUnitFactory unitFactory, IResourceFactory resourceFactory, EmpireDatabase database, IInputReader reader, IOutputWritter writter) { this.buildingFactory = buildingFactory; this.unitFactory = unitFactory; this.resourceFactory = resourceFactory; this.database = database; this.reader = reader; this.writter = writter; }
public PhonebookManager() { this.resultReporter = new OutputWritter(new StringBuilder()); this.commandExecutor = new CommandExecutor( new CommandFactory( this.resultReporter, new CanonicalPhoneConverter(this.defaultCountryCode), new PhonebookRepository())); }
public GumMachine(int balls, IOutputWritter writter) { _balls = balls; _writter = writter; SoldOut = new SoldOutState(this,_writter); NoPenny = new NoPennyState(this, _writter); Sold = new SoldState(this, _writter); HasPenny = new HasPennyState(_writter, this); CurrentState = _balls<=0 ? SoldOut : NoPenny; }
protected SpyAgent(string name, IOutputWritter writter) { Name = name; _writter = writter; }
/// <summary> /// Case of agent. /// </summary> /// <param name="name"></param> /// <param name="writter"></param> public James(string name, IOutputWritter writter) : base(name, writter) { }
public HasPennyState(IOutputWritter writter, GumMachine gumMachine) { _writter = writter; _gumMachine = gumMachine; }
public MyHomeComputer(IOutputWritter writtter) { _writter = writtter; }
/// <summary> /// Case of Agent (Aegnt Tanya) /// </summary> /// <param name="name">Agent names</param> /// <param name="writter">Output</param> public Tanya(string name, IOutputWritter writter) : base(name, writter) { }
public LettersReaderTests() { this.writter = Substitute.For<IOutputWritter>(); this.reader = new LettersReader(this.writter); }
public NoPennyState(GumMachine gumMachine, IOutputWritter writter) { _gumMachine = gumMachine; _writter = writter; }
public Stereo(IOutputWritter writter) { _writter = writter; Active = false; Volume = 0; }
protected Weapon(int damage, string name, IOutputWritter writter) { Damage = damage; Name = name; _writter = writter; }
protected Primitive(IOutputWritter writter) { _writter = writter; }
public CalculatorGui(ICalculator calculator, IInputReader inputReader, IOutputWritter outputWritter) { this.calculator = calculator; this.inputReader = inputReader; this.outputWritter = outputWritter; }
public Transmission(IOutputWritter writter) { _writter = writter; Status = TransmissonStatus.Auto; Gear = Gears.N; }
public Sword(string name, int dmg, IOutputWritter writter) : base(dmg,name, writter) { Type = new SwordType(); }
public MySmartPhone(IOutputWritter writter) { _writter = writter; }
protected PostBehavior(IOutputWritter writter) { _writter = writter; }
public Engine(IOutputWritter writter) { Active = false; _writter = writter; }
public SoldState(GumMachine machine, IOutputWritter writter) { _machine = machine; _writter = writter; }
public Bone(string name,int dmg, IOutputWritter writter) : base(dmg, name, writter) { Type = new BoneType(); }