Ejemplo n.º 1
0
        public void TestThatStaticTextGetAllReturnsStaticTexts()
        {
            var staticTexts = _systemDataRepository.StaticTextGetAll();

            // ReSharper disable PossibleMultipleEnumeration
            Assert.That(staticTexts, Is.Not.Null);
            Assert.That(staticTexts, Is.Not.Empty);
            Assert.That(staticTexts.Count(), Is.EqualTo(Enum.GetValues(typeof(StaticTextType)).Cast <StaticTextType>().Count()));
            // ReSharper restore PossibleMultipleEnumeration
        }
        /// <summary>
        /// Functionality which handles the query for getting a collection of static texts.
        /// </summary>
        /// <param name="query">Query for getting a collection of static texts.</param>
        /// <returns>Collection of static texts.</returns>
        public virtual IEnumerable <StaticTextSystemView> Query(StaticTextCollectionGetQuery query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            var translationInfo = _systemDataRepository.Get <ITranslationInfo>(query.TranslationInfoIdentifier);
            var staticTexts     = _systemDataRepository.StaticTextGetAll();

            return(_foodWasteObjectMapper.Map <IEnumerable <IStaticText>, IEnumerable <StaticTextSystemView> >(staticTexts, translationInfo.CultureInfo));
        }