コード例 #1
0
        public void MarkServerAsStoppedAfterThreeAttempts()
        {
            var gameServer  = GetGameServer();
            var procManager = new ServerProcessManagerWin(_logger, _clProces.Object);

            gameServer.GameServerCurrentStats.RestartAttempts = 3;
            var result = procManager.HandleCrashedServer(gameServer);

            Assert.Equal(ServerStatusStates.Stopped, result.GameServerCurrentStats.Status);
        }
コード例 #2
0
        public void MarkServerAsCrashed()
        {
            var gameServer  = GetGameServer();
            var procManager = new ServerProcessManagerWin(_logger, _clProces.Object);

            gameServer.GameServerCurrentStats.Pid = Process.GetCurrentProcess().Id;;  // TODO: This is hacky and just prevnts the it attempting to start the server
            var result = procManager.HandleCrashedServer(gameServer);

            Assert.Equal(ServerStatusStates.Crashed, result.GameServerCurrentStats.Status);
        }