Example #1
0
        public async Task GetChallangesBYClubCategoryId()
        {
            try
            {
                // Arrange
                ChallengeProvider _ChallengeProvider = new ChallengeProvider();
                var testProducts = await _ChallengeProvider.GetChallanges(1, 6) as List <Challenge>;

                int testproduct = testProducts.Count;

                // Assert
                Assert.IsNotNull(testProducts);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public async Task <HttpResponseMessage> GetChallengesByCategoryClub(int categoryid, int clubid)
        {
            try
            {
                var entity = await _ChallengeProvider.GetChallanges(categoryid, clubid);

                if (entity != null)
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, entity));
                }
                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Challenge not found"));
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
            }
        }