Пример #1
0
 public void BeforeEach()
 {
     this.logs        = new List <string>();
     this.manager     = Program.Process.CreateManager(null);
     this.commandLine = new Program.CommandLine("test", s => this.logs.Add(s), this.manager);
     this.arHandler   = new Program.AutoRoutineHandler(this.commandLine);
 }
Пример #2
0
 public void BeforeEach()
 {
     this.logs.Clear();
     this.manager = Program.Process.CreateManager(null);
     this.cmdLine = new Program.CommandLine("Test", s => this.logs.Add(s), this.manager);
     this.manager.KillAll();
 }
        public void BeforeEach()
        {
            this.connector = new MockShipConnector()
            {
                CubeGrid = new MockCubeGrid()
                {
                    GridSizeEnum = VRage.Game.MyCubeSize.Small
                },
                CustomData      = @"[connection-client]
  connector-name=connector name
  server-channel=server channel
",
                CustomName      = "connector name",
                DisplayNameText = "connector name",
                WorldMatrix     = MatrixD.Identity,
                WorldPosition   = new Vector3D(5, 15, 25)
            };
            this.gts = new MockGridTerminalSystem()
            {
                this.connector
            };
            this.listener = new MockUnicastListener();
            this.igc      = new MockIntergridCommunicationSystem()
            {
                UnicastListener = this.listener
            };
            this.manager     = Program.Process.CreateManager(null);
            this.commandLine = new Program.CommandLine("test", null, this.manager);
        }
Пример #4
0
 public void BeforeEach()
 {
     this.commandCalls = new List <string>();
     this.manager      = Program.Process.CreateManager(s => System.Diagnostics.Debug.WriteLine(s));
     this.commandLine  = new Program.CommandLine("test", null, this.manager);
     this.commandLine.RegisterCommand(new Program.Command("cmd", this.command, "", requiredTrigger: Program.CommandTrigger.Cmd));
     this.mock    = new Program.MockAction();
     this.process = this.manager.Spawn(null, "test");
 }
Пример #5
0
        public void Everything()
        {
            var grid = new MockCubeGrid {
                GridSizeEnum = VRage.Game.MyCubeSize.Small
            };

            var controller = new MockShipController {
                CubeGrid      = grid,
                ShipMass      = new Sandbox.ModAPI.Ingame.MyShipMass(1820, 1820, 1820),
                WorldPosition = Vector3D.Zero,
                WorldMatrix   = MatrixD.Identity
            };


            var gts = new MockGridTerminalSystem {
                PowerWheelTest.GetSuspension(new Vector3D(-1, 0, -1), true, grid),
                PowerWheelTest.GetSuspension(new Vector3D(1, 0, -1), false, grid),
                PowerWheelTest.GetSuspension(new Vector3D(-1, 0, 1), true, grid),
                PowerWheelTest.GetSuspension(new Vector3D(1, 0, 1), false, grid),
            };

            var transformer = new Program.CoordinatesTransformer(controller);

            var ini = new VRage.Game.ModAPI.Ingame.Utilities.MyIni();

            ini.TryParse(@"");

            var saveManager = new Program.ProcessSpawnerMock();

            var command = new Program.CommandLine("mock", null, saveManager);

            var wc = new Program.WheelsController(command, controller, gts, ini, saveManager, transformer);

            Assert.AreEqual(new Vector3D(0, 1, 0), wc.GetContactPlaneW());

            Assert.AreEqual(new Vector3D(0, -1.75, -1), wc.GetPointOfContactW(new Vector3D(0, 0, -1)));

            wc.SetPosition("0.5"); // too anoying to test
        }
Пример #6
0
 public void BeforeEach()
 {
     this.manager     = Program.Process.CreateManager(null);
     this.commandLine = new Program.CommandLine("test", null, this.manager);
     this.parser      = new Program.RoutineParser(this.commandLine);
 }