Exemple #1
0
        public void TestThatStorageTypeGetAllGetGetsStorageTypeViewCollection()
        {
            IFoodWasteHouseholdDataService 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 <StorageTypeView> storageTypeCollection = new List <StorageTypeView>(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);
            }
        }