public void get_eth_usd_price_should_return_amount() { const decimal price = 187; const ulong updatedAt = 123456789; _priceService.Get("USDT_ETH").Returns(new PriceInfo(price, updatedAt)); var result = _rpc.ndm_getUsdPrice("USDT_ETH"); result.Data.Price.Should().Be(price); result.Data.UpdatedAt.Should().Be(updatedAt); }
// GET: Pricing public ActionResult Index() { try { if (Session["auth_info"] != null) { var authInfo = (AuthInfo)Session["auth_info"]; var data = _priceService.Get(authInfo.CurrentSelectedClinic.ClinicId); ViewBag.idSelected = "pricing"; return(View(data)); } else { return(RedirectToAction("Index", "Home")); } } catch (Exception) { return(View()); } }
public ActionResult Index() { if (Session["auth_info"] != null) { try { var authInfo = (AuthInfo)Session["auth_info"]; var doctor = _userService.GetDoctorsByClinic(authInfo.CurrentSelectedClinic.ClinicId) .Select(x => new KeyValueResult(x.DoctorId, x.FullName)) .ToList(); var userType = authInfo.DoctorClinics.First(x => x.Clinic.ClinicId == authInfo.CurrentSelectedClinic.ClinicId).ClinicUserUserType; var doctorWork = userType == (int)UserType.PracticeManager ? new SelectList(doctor.ToList(), "Key", "Value") : (userType == (int)UserType.Doctor ? new SelectList(new List <KeyValueResult> { new KeyValueResult(authInfo.DoctorId, authInfo.FullName) }, "Key", "Value") : new SelectList(new List <KeyValueResult>(), "Key", "Value")); var listPrices = _priceService.Get(authInfo.CurrentSelectedClinic.ClinicId); var listPricing = new SelectList(listPrices.ToList(), "Duration", "Duration"); ViewBag.ListDoctor = doctorWork; ViewBag.ListPrices = listPricing; ViewBag.CanCreateAppoinment = true; doctor.Insert(0, new KeyValueResult("all", "All Doctors")); ViewBag.DoctorFilter = new SelectList(doctor, "Key", "Value"); } catch (ApiException) { return(RedirectToAction("Index", "Home")); } return(View()); } else { return(RedirectToAction("Index", "Home")); } }