Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
        public void TestSetUp()
        {
            var container = ContainerFactory.Create();

            _householdDataRepository = container.Resolve <IHouseholdDataRepository>();
            _householdDataService    = container.Resolve <IFoodWasteHouseholdDataService>();
        }
Exemplo n.º 3
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)));
        }