public void TestGetRateCategory_ListOfRateCategory()
        {
            //Arrange
            int id           = 1;
            var rateCategory = new RateCategoryList()
            {
                Id = id, Name = "Category1", IsActive = true, RoomTypeName = "Type1", Markets = "XYX"
            };
            var baseResult = new BaseResult <List <RateCategoryList> >()
            {
                Result = new List <RateCategoryList>()
                {
                    rateCategory
                }
            };

            iRateCategoryListLibrary.Setup(a => a.ExecuteStoredProcedure(It.IsAny <string>(), It.IsAny <DynamicParameters>())).Returns(Task.FromResult(baseResult));
            //Act
            var ratecategoryList = rateCategoryRepository.GetRateCategory(id);

            //Assert
            Assert.IsTrue(ratecategoryList != null);
            Assert.IsTrue(ratecategoryList.Result is BaseResult <List <RateCategoryList> >);
            Assert.IsTrue(ratecategoryList.Result.Result.Exists(x => x.Id == id));
        }
        public async Task <IActionResult> GetRateCategory([FromBody] int hotelId)
        {
            if (hotelId <= default(int))
            {
                return(BadRequest());
            }
            BaseResult <List <RateCategoryList> > rateCategoryResult = new BaseResult <List <RateCategoryList> >();

            rateCategoryResult = await iRatesCategory.GetRateCategory(hotelId);

            if (rateCategoryResult.IsError && rateCategoryResult.ExceptionMessage != null)
            {
                return(new StatusCodeResult(500));
            }
            else if (!rateCategoryResult.Result.Any())
            {
                return(NoContent()); //204
            }
            var responseResult = RatesCategoryResponseMapper.MapRateCategoryList(rateCategoryResult.Result);

            return(Ok(responseResult));
        }