public void GetContest_EmptyGuid_Returns()
        {
            //arrange
            
            //act
            var result = _sut.GetContest(Guid.Empty);

            //assert
            Assert.IsNotNull(result);
            Assert.AreEqual(null, result.Result.Champion);
        }
Пример #2
0
        public virtual Task <ContestResponse> GetContest(Guid sessionId)
        {
            try
            {
                var result = ContestRepository.GetContest(sessionId);

                return(result);
            }
            catch (Exception ex)
            {
                Logger.Error("ContestService.GetContest failed", this, ex);
            }

            return(null);
        }
Пример #3
0
 public HttpResponseMessage <Contest> Get(int code, HttpRequestMessage request)
 {
     try
     {
         return(new HttpResponseMessage <Contest>(contestRepository.GetContest(code))
         {
             StatusCode = HttpStatusCode.OK
         });
     }
     catch (Exception ex)
     {
         return(new HttpResponseMessage <Contest>(null)
         {
             StatusCode = HttpStatusCode.InternalServerError
         });
     }
 }