Example #1
0
        private AuctionRead[] GetFakeAuctionsReadModels()
        {
            var testCategoryTree = _categoryTreeService.GetCategoriesTree();
            var testCategory     = new Category(testCategoryTree.SubCategories[0]
                                                .CategoryName, 0);

            testCategory.SubCategory = new Category(testCategoryTree.SubCategories[0]
                                                    .SubCategories[0]
                                                    .CategoryName, 1);
            testCategory.SubCategory.SubCategory = new Category(testCategoryTree.SubCategories[0]
                                                                .SubCategories[0]
                                                                .SubCategories[0]
                                                                .CategoryName, 2);

            var auctions = new AuctionRead[AuctionsByCategoryQueryHandler.PageSize * 2];

            for (var i = 0; i < auctions.Length; i++)
            {
                auctions[i] = new AuctionRead()
                {
                    ActualPrice = 20,
                    AuctionId   = Guid.NewGuid()
                                  .ToString(),
                    BuyNowPrice = 21,
                    StartDate   = DateTime.UtcNow,
                    EndDate     = DateTime.UtcNow.AddDays(1),
                    Category    = testCategory,
                    BuyNowOnly  = false,
                    Product     = new Product("test product name", "example description", Condition.Used)
                };
            }

            return(auctions);
        }
Example #2
0
        /// <summary>
        /// Called when [auction queued].
        /// </summary>
        /// <param name="monitor">The monitor.</param>
        /// <param name="line">The line.</param>
        protected virtual void OnAuctionQueued(AuctionMonitor monitor, string line)
        {
            var evtArgs = new AuctionReadEventArgs(line)
            {
                CharacterName = monitor.CharacterName,
                FileName      = monitor.File.Name
            };

            AuctionRead?.Invoke(this, evtArgs);
        }
Example #3
0
        public void SetUp()
        {
            _categoryTreeService = TestDepedencies.Instance.Value.CategoryTreeService;
            _dbContext           = TestDepedencies.Instance.Value.DbContext;
            var testCategoryTree = _categoryTreeService.GetCategoriesTree();
            var testCategory     = new Category(testCategoryTree.SubCategories[0].CategoryName, 0);

            testCategory.SubCategory             = new Category(testCategoryTree.SubCategories[0].SubCategories[0].CategoryName, 1);
            testCategory.SubCategory.SubCategory = new Category(testCategoryTree.SubCategories[0].SubCategories[0].SubCategories[0].CategoryName, 2);
            stubAuction = new AuctionRead()
            {
                ActualPrice = 20,
                AuctionId   = Guid.NewGuid().ToString(),
                BuyNowPrice = 21,
                StartDate   = DateTime.UtcNow.AddMinutes(12),
                EndDate     = DateTime.UtcNow.AddDays(1),
                Category    = testCategory,
                Product     = new Product("test product name", "example description", Condition.New)
            };
        }