public void NotSaveMatchResultFromUnknownServer()
        {
            var result = handler.TryPutMatch(match);

            result.Should().BeFalse();
            db.GetMatches(match.endpoint).Count().Should().Be(0);
        }
示例#2
0
        private Task <HttpStatusCode> AddMatchInfoAsync(MatchInfo match)
        {
            var task = new Task <HttpStatusCode>(() =>
            {
                try
                {
                    var success = handler.TryPutMatch(match);
                    return(success ? HttpStatusCode.OK : HttpStatusCode.BadRequest);
                }
                catch (Exception e)
                {
                    logger.Error(e.Message);
                    return(HttpStatusCode.InternalServerError);
                }
            });

            task.Start();
            return(task);
        }