Example #1
0
        public void SearchManufacturerByKeyword_ManufacturerContains_1Result()
        {
            _instrumentService = InstrumentServiceFactory.CreateForSearch(_instrumentRepository);
            _instrumentService.Create(Guid.NewGuid(), "Bird", "DPI601IS", "None", "Digital Pressure Indicator", 0);
            _instrumentService.Create(Guid.NewGuid(), "Druck", "DPI701IS", "None", "Digital Pressure Indicator", 0);
            _instrumentService.Create(Guid.NewGuid(), "Druck", "DPI701IS", "None", "Digital Pressure Indicator", 0);
            _instrumentService.Create(Guid.NewGuid(), "Fluke", "DruckDPI601", "None", "Digital Pressure Indicator", 0);

            var instruments = _instrumentService.SearchManufacturerByKeyword("dru").ToList();

            Assert.AreEqual(1, instruments.Count);
            _instrumentRepository.DeleteAll();
        }
Example #2
0
        public ActionResult SearchManufacturers(string query)
        {
            IEnumerable <string> manufacturers = _instrumentService.SearchManufacturerByKeyword(query);

            return(Json(manufacturers));
        }