Exemplo n.º 1
0
 public ActionResult Search(string value)
 {
     if (String.IsNullOrEmpty(value))
     {
         return(Content(JsonConvert.SerializeObject(_exhibits.Get())));
     }
     else
     {
         return(Content(JsonConvert.SerializeObject(_exhibits.GetBySearchString(value))));
     }
 }
Exemplo n.º 2
0
 // GET: Home
 public ActionResult Index()
 {
     return(View(new HomeViewModel
     {
         Events = _events.Get(),
         Exhibits = _exhibits.Get()
     }));
 }
Exemplo n.º 3
0
        public void TestGetAll()
        {
            // Arrange
            ExhibitsService service = Scope.Resolve <ExhibitsService>();

            // Act
            IEnumerable <Exhibit> result = service.Get();

            // Assert
            Assert.IsTrue(_exhibits.Except(result).Count() == 0);
        }
Exemplo n.º 4
0
        public void TestGetById()
        {
            // Arrange
            ExhibitsService service = Scope.Resolve <ExhibitsService>();

            // Act
            Exhibit result = service.Get(_exhibits.First().ExhibitID);

            // Assert
            Assert.IsNotNull(result);
        }