Beispiel #1
0
        public void SetupGameHost()
        {
            isNUnitRunning = true;

            host   = new HeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false);
            runner = CreateRunner();

            if (!(runner is Game game))
            {
                throw new InvalidCastException($"The test runner must be a {nameof(Game)}.");
            }

            runTask = Task.Factory.StartNew(() => host.Run(game), TaskCreationOptions.LongRunning);
        }
Beispiel #2
0
        public void SetupGameHost()
        {
            host   = new HeadlessGameHost($"{GetType().Name}-{Guid.NewGuid()}", realtime: false);
            runner = CreateRunner();

            if (!(runner is Game game))
            {
                throw new InvalidCastException($"The test runner must be a {nameof(Game)}.");
            }

            runTask = Task.Factory.StartNew(() => host.Run(game), TaskCreationOptions.LongRunning);
            while (!game.IsLoaded)
            {
                checkForErrors();
                Thread.Sleep(10);
            }
        }