public async void SearchSurgeryBuilder_With_Valid_String_Returns_Results() { var surgeries = new[] { new Surgery() { SurgeryId = "1" }, new Surgery() { SurgeryId = "2" }, }; _mockRestfulHelper.Setup(r => r.GetAsync(It.IsAny <string>())).ReturnsAsync(JsonConvert.SerializeObject(surgeries)); var surgeryResults = await _surgeryBuilder.SearchSurgeryBuilder("x"); Assert.IsInstanceOf(typeof(List <Surgery>), surgeryResults); Assert.AreEqual(surgeryResults.Count, 2); }
public async Task <JsonResult> SearchSurgery(string input) { return(Json((await _surgeryBuilder.SearchSurgeryBuilder(input)))); }