public void Search_by_filled_combo_box()
        {
            IMedicationServerController medicationServerController = new MedicationServerController();

            var medication = medicationServerController.GetAllMedicationByName("Bromazepam");

            Assert.NotEmpty(medication);
        }
        public void Search_by_empty_combo_box()
        {
            IMedicationServerController medicationServerController = new MedicationServerController();

            var medication = medicationServerController.GetAllMedicationByName(AllConstants.EmptyComboBox);

            Assert.Empty(medication);
        }
        public AdditionalInformationDTO GetContentRows()
        {
            IMedicationServerController medicationServerController = new MedicationServerController();
            IEnumerable <MedicationDto> allMedications             = medicationServerController.GetAllMedication();

            string[] medicationContentRows = new string[allMedications.Count()];
            for (int i = 0; i < allMedications.Count(); i++)
            {
                medicationContentRows[i] = allMedications.ElementAt(i).Name + AllConstants.ContentSeparator + allMedications.ElementAt(i).Quantity;
            }
            return(new AdditionalInformationDTO()
            {
                MapObjectId = id,
                ContentRows = medicationContentRows
            });
        }
Пример #4
0
        public List <SearchResultDTO> GetSearchResult()
        {
            IMedicationServerController medicationServerController = new MedicationServerController();
            IMapObjectController        mapObjectController        = new MapObjectController();
            List <MedicationDto>        searchResults = medicationServerController.GetAllMedicationByName(name).ToList();
            List <SearchResultDTO>      retVal        = new List <SearchResultDTO>();

            MapObject mo = mapObjectController.GetMapObjectById(AllConstants.StorageRoomId);

            for (int i = 0; i < searchResults.Count(); i++)
            {
                MedicationDto   medicationDto   = searchResults.ElementAt(i);
                SearchResultDTO searchResultDTO = new SearchResultDTO()
                {
                    MapObjectId = mo.Id,
                    Content     = medicationDto.Quantity + AllConstants.ContentSeparator + MapObjectSearchResult.MapObjectToRow(mo)
                };
                retVal.Add(searchResultDTO);
            }
            return(retVal);
        }