示例#1
0
        public void TestThatTranslationInfoGetAllGetsTranslationInfoSystemViewCollection()
        {
            TranslationInfoCollectionGetQuery translationInfoCollectionGetQuery   = new TranslationInfoCollectionGetQuery();
            IList <TranslationInfoSystemView> translationInfoSystemViewCollection = new List <TranslationInfoSystemView>(_foodWasteSystemDataService.TranslationInfoGetAll(translationInfoCollectionGetQuery));

            Assert.That(translationInfoSystemViewCollection, Is.Not.Null);
            Assert.That(translationInfoSystemViewCollection, Is.Not.Empty);
        }
        /// <summary>
        /// Functionality which handles the query for getting a collection of translation informations.
        /// </summary>
        /// <param name="query">Query for getting a collection of translation informations.</param>
        /// <returns>Collection of translation informations.</returns>
        public virtual IEnumerable <TranslationInfoSystemView> Query(TranslationInfoCollectionGetQuery query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }
            var translationInfoCollection = _systemDataRepository.TranslationInfoGetAll();

            return(_foodWasteObjectMapper.Map <IEnumerable <ITranslationInfo>, IEnumerable <TranslationInfoSystemView> >(translationInfoCollection.Where(m => m.Identifier.HasValue).OrderBy(m => m.CultureName)));
        }
 public virtual IEnumerable <TranslationInfoSystemView> TranslationInfoGetAll(TranslationInfoCollectionGetQuery query)
 {
     if (query == null)
     {
         throw new ArgumentNullException(nameof(query));
     }
     try
     {
         return(_queryBus.Query <TranslationInfoCollectionGetQuery, IEnumerable <TranslationInfoSystemView> >(query));
     }
     catch (Exception ex)
     {
         throw _foodWasteFaultExceptionBuilder.Build(ex, SoapNamespaces.FoodWasteHouseholdDataServiceName, MethodBase.GetCurrentMethod());
     }
 }
示例#4
0
        public void TestThatTranslationInfoGetAllGetsTranslationInfoSystemViewCollection()
        {
            var client = _channelFactory.CreateChannel();

            try
            {
                TranslationInfoCollectionGetQuery translationInfoCollectionGetQuery   = new TranslationInfoCollectionGetQuery();
                IList <TranslationInfoSystemView> translationInfoSystemViewCollection = new List <TranslationInfoSystemView>(client.TranslationInfoGetAll(translationInfoCollectionGetQuery));
                Assert.That(translationInfoSystemViewCollection, Is.Not.Null);
                Assert.That(translationInfoSystemViewCollection, Is.Not.Empty);
            }
            finally
            {
                ChannelTools.CloseChannel(client);
            }
        }
示例#5
0
        /// <summary>
        /// Gets all the translatios informations.
        /// </summary>
        /// <param name="client">The client to the service which can access and modify data on a house hold in the food waste domain.</param>
        /// <returns>Colleciton of all the translatios informations.</returns>
        private IList <TranslationInfoSystemView> GetTranslationInfoCollection(IFoodWasteHouseholdDataService client)
        {
            TranslationInfoCollectionGetQuery translationInfoCollectionGetQuery = new TranslationInfoCollectionGetQuery();

            return(new List <TranslationInfoSystemView>(client.TranslationInfoGetAll(translationInfoCollectionGetQuery)));
        }
示例#6
0
        /// <summary>
        /// Gets all the translatios informations.
        /// </summary>
        /// <returns>Colleciton of all the translatios informations.</returns>
        private IList <TranslationInfoSystemView> GetTranslationInfoCollection()
        {
            TranslationInfoCollectionGetQuery translationInfoCollectionGetQuery = new TranslationInfoCollectionGetQuery();

            return(new List <TranslationInfoSystemView>(_foodWasteSystemDataService.TranslationInfoGetAll(translationInfoCollectionGetQuery)));
        }