public ActionResult Search(string value) { if (String.IsNullOrEmpty(value)) { return(Content(JsonConvert.SerializeObject(_exhibits.Get()))); } else { return(Content(JsonConvert.SerializeObject(_exhibits.GetBySearchString(value)))); } }
// GET: Home public ActionResult Index() { return(View(new HomeViewModel { Events = _events.Get(), Exhibits = _exhibits.Get() })); }
public void TestGetAll() { // Arrange ExhibitsService service = Scope.Resolve <ExhibitsService>(); // Act IEnumerable <Exhibit> result = service.Get(); // Assert Assert.IsTrue(_exhibits.Except(result).Count() == 0); }
public void TestGetById() { // Arrange ExhibitsService service = Scope.Resolve <ExhibitsService>(); // Act Exhibit result = service.Get(_exhibits.First().ExhibitID); // Assert Assert.IsNotNull(result); }