public void TestThatStorageTypeGetAllGetGetsStorageTypeSystemViewCollection()
        {
            IFoodWasteSystemDataService client = _channelFactory.CreateChannel();

            try
            {
                IList <TranslationInfoSystemView> translationInfoCollection = GetTranslationInfoCollection(client);
                Assert.That(translationInfoCollection, Is.Not.Null);
                Assert.That(translationInfoCollection, Is.Not.Empty);

                foreach (TranslationInfoSystemView translationInfo in translationInfoCollection)
                {
                    StorageTypeCollectionGetQuery storageTypeCollectionGetQuery = new StorageTypeCollectionGetQuery
                    {
                        TranslationInfoIdentifier = translationInfo.TranslationInfoIdentifier
                    };
                    IList <StorageTypeSystemView> storageTypeCollection = new List <StorageTypeSystemView>(client.StorageTypeGetAll(storageTypeCollectionGetQuery));
                    Assert.That(storageTypeCollection, Is.Not.Null);
                    Assert.That(storageTypeCollection, Is.Not.Empty);
                    Assert.That(storageTypeCollection.Count, Is.EqualTo(4));
                    Assert.That(storageTypeCollection.SingleOrDefault(m => m.StorageTypeIdentifier == StorageType.IdentifierForRefrigerator), Is.Not.Null);
                    Assert.That(storageTypeCollection.SingleOrDefault(m => m.StorageTypeIdentifier == StorageType.IdentifierForFreezer), Is.Not.Null);
                    Assert.That(storageTypeCollection.SingleOrDefault(m => m.StorageTypeIdentifier == StorageType.IdentifierForKitchenCabinets), Is.Not.Null);
                    Assert.That(storageTypeCollection.SingleOrDefault(m => m.StorageTypeIdentifier == StorageType.IdentifierForShoppingBasket), Is.Not.Null);
                }
            }
            finally
            {
                ChannelTools.CloseChannel(client);
            }
        }
Exemple #2
0
        public void TestSetUp()
        {
            var container = ContainerFactory.Create();

            _foodWasteSystemDataService = container.Resolve <IFoodWasteSystemDataService>();
        }
        /// <summary>
        /// Gets all the translatios informations.
        /// </summary>
        /// <param name="client">The client to the service which can access and modify system data in the food waste domain.</param>
        /// <returns>Colleciton of all the translatios informations.</returns>
        private IList <TranslationInfoSystemView> GetTranslationInfoCollection(IFoodWasteSystemDataService client)
        {
            TranslationInfoCollectionGetQuery translationInfoCollectionGetQuery = new TranslationInfoCollectionGetQuery();

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