public void CanRetrieveValidCombination()
        {
            IStyleRuleRepository     srr = new StyleRuleRepository();
            IClosetRepository        cr  = new ClosetRepository();
            IGarmentRepository       gr  = new GarmentRepository();
            IFashionFlavorRepository fr  = new FashionFlavorRepository();

            IOutfitEngineProcessor processor = new OutfitEngineProcessor(srr, cr);

            IOutfitEngineService service = new OutfitEngineService(gr, cr, processor, fr);

            IList <int> lst    = new List <int>();
            string      values = "457546,1358386,2144626,2570491";

            foreach (string val in values.Split(','))
            {
                lst.Add(Convert.ToInt32(val));
            }

            IList <int> lstFlavors = new List <int>();

            lstFlavors.Add(1);

            Assert.IsTrue(service.HasValidCombinations(lst, lstFlavors));
        }
Esempio n. 2
0
        public void CanCreatePreCombinations()
        {
            ICombinationRepository    repCombination    = new CombinationRepository();
            IPreCombinationRepository repPreCombination = new PreCombinationRepository();
            IStyleRuleRepository      repStyleRule      = new StyleRuleRepository();
            IOutfitEngineProcessor    processor         = new OutfitEngineProcessor(repStyleRule);

            OutfitEngineService oes = new OutfitEngineService(
                repCombination,
                repPreCombination,
                processor);

            IList <PreGarment> pregarments = new PreGarmentRepository().GetFetched();

            foreach (FashionFlavor fv in new FashionFlavorRepository().GetAll())
            {
                //if (fv.Name.Contains("Preppy") || fv.Name.Contains("Trendy"))
                //    continue;

                IList <FashionFlavor> flavors = new List <FashionFlavor>();
                flavors.Add(fv);

                IList <PreGarment> reducedPregarments = (from cg in pregarments
                                                         where
                                                         cg.PreSilouhette.Flavors.Contains(fv)
                                                         select cg).ToList <PreGarment>();

                Console.WriteLine("Amount of pregarments: {0}", reducedPregarments.Count);

                oes.CreatePreCombinations(
                    flavors,
                    reducedPregarments);
            }
        }
Esempio n. 3
0
        public void CanGenerateValidCombinations()
        {
            IOutfitEngineProcessor processor = new OutfitEngineProcessor(CreateMockStyleRulesRepository());

            processor.Garments       = CreatePreGarments();
            processor.FashionFlavors = CreateFashionFlavors(); //.Add(CreateFashionFlavors()[0]);
            processor.EventTypes.Add(CreateEventTypes()[0]);

            Assert.IsTrue(processor.HasValidCombinations());
        }
        public void CanCombine()
        {
            IStyleRuleRepository     srr = new StyleRuleRepository();
            IClosetRepository        cr  = new ClosetRepository();
            IGarmentRepository       gr  = new GarmentRepository();
            IFashionFlavorRepository fr  = new FashionFlavorRepository();

            IOutfitEngineProcessor processor = new OutfitEngineProcessor(srr, cr);

            IOutfitEngineService service = new OutfitEngineService(gr, cr, processor, fr);

            service.CreateOutfits(1);
        }
Esempio n. 5
0
        public static IOutfitEngineService CreateOutfitEngineService()
        {
            IStyleRuleRepository  srr = new StyleRuleRepository();
            IClosetRepository     cr  = new ClosetRepository();
            IIndexCreationService ois = new IndexCreationService(new ClosetRepository(), new ClosetOutfitRepository());
            IOutfitUpdaterService ous = new OutfitUpdaterService(new OutfitUpdaterRepository(),
                                                                 new PreCombinationRepository(), srr);

            IOutfitEngineProcessor processor = new OutfitEngineProcessor(srr, cr, ous, ois);


            IGarmentRepository       gr = new GarmentRepository();
            IFashionFlavorRepository fr = new FashionFlavorRepository();

            return(new OutfitEngineService(gr, cr, processor, fr));
        }