public void Test_GetAllListingById() { User user = new User { UserId = 1, }; var sut = ListingHelper.GetAllListingById(user.UserId); Assert.NotEmpty(sut); }
public IActionResult GetListing() { List <dm.Listing> listings = ListingHelper.GetAllListingById((int)HttpContext.Session.GetInt32("UserId")); var model = new ConversionNewListing(); List <CreateNewListingViewModel> viewModel = model.MappingViewListings(listings); foreach (var item in viewModel) { var productInfo = ListingHelper.GetProductIdByListingId(item.ListingId); item.ProductTitle = productInfo.ProductTitle; item.ImageUrl = productInfo.ImageUrl; } return(View("~/Views/Partials/GetListings.cshtml", viewModel)); }