public int MEM; //Used by Get(Final)Status public JobEntry(Houston houston, TabControl theTabs, TabPage tabInput, TabPage tabLog) { _houston = houston; _theTabs = theTabs; _tabInput = tabInput; _tabLog = tabLog; _inputFile = new OpenAndSave(); _inputFile.Filter = "SFBox Input Files (*.in)|*.in|Text Files (*.txt)|*.txt|All Files (*.*)|*.*"; //_inputFile.Multiselect = true; //werkt niet _inputFile.ReadData += new OpenAndSave.ReadDataEventHandler(ReadData); _inputFile.WriteData += new OpenAndSave.WriteDataEventHandler(WriteData); _inputFile.RevertData += new OpenAndSave.RevertDataEventHandler(RevertData); _inputFile.FileNameChanged += new OpenAndSave.FileNameChangedEventHandler(FileNameChanged_Handler); _inputFile.FolderNameChanged += new OpenAndSave.FolderNameChangedEventHandler(FolderNameChanged_Handler); _fileWatch = new FileSystemWatcher(); _fileWatch.NotifyFilter = NotifyFilters.LastWrite; _fileWatch.Changed += FileChanged_Handler; for (int i = 1; i < Enum.GetNames(typeof(Display)).Length; i++) { //Init the subitems SubItems.Add(""); } SetupJob(); }
public void MustSetUpSurfaceThrowException(string command) { var serviceProvider = Services.CreateAndGetServices(); var houston = new Houston(serviceProvider); var action = new Action(() => houston.SendCommand(command)); action.Should().Throw <Exception>().WithMessage("surface is not set up"); }
public void WrongCommandThrowException(string command) { var serviceProvider = Services.CreateAndGetServices(); var houston = new Houston(serviceProvider); var action = new Action(() => houston.SendCommand(command)); action.Should().Throw <Exception>().WithMessage("command is not provided"); }
static void MessageBoxShow(Houston owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) { if (!owner.InvokeRequired) { MessageBox.Show(owner, text, caption, buttons, icon); } else { owner.Invoke(new MessageBoxShowDelegate(MessageBoxShow), new object[] { owner, text, caption, buttons, icon }); } }
public SpaceCenterShould() { _mockLandingSurface = new Mock <ILandingSurface>(); _mockSquad = new Mock <ISquad>(); _commandManager = new CommandManager(); _sut = new Houston(_mockLandingSurface.Object, _commandManager); _sut.Order = new Order() { Instructions = "LMLMLMMR", LandingPosition = new Position(1, 1), Orientation = Orientation.N }; }
public void LocationBoundThrowException(string plataeuCommand, string command) { var serviceProvider = Services.CreateAndGetServices(); var houston = new Houston(serviceProvider); houston.SendCommand(plataeuCommand); var action = new Action(() => houston.SendCommand(command)); action.Should().Throw <Exception>().WithMessage("location is not valid"); }
public void ACircleReturnsToInitialPosition(string command) { // Arrange var serviceProvider = Services.CreateAndGetServices(); var houston = new Houston(serviceProvider); houston.SendCommand("2 2"); houston.SendCommand("1 1 W"); var rover = serviceProvider.GetService <IRoverManager>().Rover; // Act houston.SendCommand(command); // Assert rover.Should().NotBeNull(); rover.X.Should().Be(1); rover.Y.Should().Be(1); rover.Direction.Should().Be(Directions.W); }
public void CreatePlatue(string command) { // Arrange var serviceProvider = Services.CreateAndGetServices(); var commands = command.Split(' '); var width = int.Parse(commands[0]); var height = int.Parse(commands[1]); ISpaceCenter houston = new Houston(serviceProvider); var plateue = serviceProvider.GetService <ISurface>(); houston.SendCommand(command); plateue.Should().NotBeNull(); plateue.Size.Should().NotBeNull(); plateue.Size.SurfaceModel.Width.Should().Be(width); plateue.Size.SurfaceModel.Height.Should().Be(height); }