Beispiel #1
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);
            }
        }
Beispiel #2
0
        static void Main()
        {
            IConfigurationRoot configuration = LoadConfiguration();

            var combinationsDatasource = configuration.GetSection("CombinationsDatasource").Value;
            var repository             = new CombinationRepository()
            {
                DataSource = combinationsDatasource
            };
            var combinations           = repository.GetCombinations();
            var combinationsCalculator = new CombinationsCalculator();
            var combination            = combinationsCalculator.GetCombinationWithMostCommonNumbers(combinations);

            Console.WriteLine($"Columns: {combination.Columns.ToSortedString()}");
            Console.WriteLine($"Stars: {combination.Stars.ToSortedString()}");

            Console.ReadLine();
        }
 public void Setup()
 {
     sut = new CombinationRepository();
 }
 public CombinationController(SiCContext context)
 {
     combinationRepository = new CombinationRepository(context);
 }