Exemplo n.º 1
0
 // Bid
 public void BidOnAuction(decimal bid, decimal currentPrice, int id, string currentWinner)
 {
     {
         AuctionProcessor APBid = new AuctionProcessor();
         APBid.BidOnAuction(bid, currentPrice, id, currentWinner);
     }
 }
        public void TestRunAuctions_WithInvalidBids_ExpectedEmptyList()
        {
            var config   = CreateConfigWithOneSite();
            var siteBids = CreateInvalidBidsForOneSite();

            var actual = new AuctionProcessor(config).RunAuctions(siteBids);

            AssertEmptyList(actual);
        }
        public void TestRunAuctions_WithMultipleSitesAndBids_ExpectedWinningBids()
        {
            var config   = CreateConfigWithMultipleSites();
            var siteBids = CreateBidsForMultipleSites();

            var actual   = new AuctionProcessor(config).RunAuctions(siteBids);
            var expected = CreateResultForMultipleSite();

            AssertResultEqual(expected, actual);
        }
        public void TestRunAuctions_WithInvalidSite_ExpectedEmptyList()
        {
            var config   = CreateConfigWithOneSite();
            var siteBids = CreateBidsForOneSite();

            siteBids[0].SiteName = "INVALID_SITE_NAME";

            var actual = new AuctionProcessor(config).RunAuctions(siteBids);

            AssertEmptyList(actual);
        }
Exemplo n.º 5
0
 public ActionResult CreateAuction(AuktionModel model)
 {
     if (ModelState.IsValid)
     {
         int recordsCreated = AuctionProcessor.CreateAuction(model.Title,
                                                             model.Tid,
                                                             model.CurrentPrice,
                                                             model.MaxPrice);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Exemplo n.º 6
0
        public void SetUp()
        {
            state = new AuctionState();

            dkpProcessor  = new Mock <IDkpProcessor>();
            itemProcessor = new Mock <IItemProcessor>();
            configuration = new DkpBotConfiguration {
                Ranks = new[] { alt, box, main }
            };
            raid = new RaidInfo();

            Mock <IMessageChannel> channel = new Mock <IMessageChannel>();

            channel.Setup(x => x.SendMessageAsync(It.IsAny <string>(), It.IsAny <bool>(), It.IsAny <Embed>(), It.IsAny <RequestOptions>()))
            .Returns(Task.FromResult(new Mock <IUserMessage>().Object));
            message = new Mock <IMessage>();
            message.SetupGet(x => x.Channel).Returns(channel.Object);

            target = new AuctionProcessor(configuration, state, itemProcessor.Object, dkpProcessor.Object, new Mock <ILogger <AuctionProcessor> >().Object);
        }
Exemplo n.º 7
0
        // Delete
        public void DeleteAuction(int id)
        {
            AuctionProcessor ctrlAuction = new AuctionProcessor();

            ctrlAuction.DeleteAuction(id);
        }
Exemplo n.º 8
0
        // Load
        public List <AuctionModel> LoadAuctions()
        {
            AuctionProcessor AP = new AuctionProcessor();

            return(AP.LoadAuctions());
        }
Exemplo n.º 9
0
        // Edit
        public void EditAuction(int id, decimal bid, int status, decimal currentPrice, decimal maxPrice, DateTime endDate, string title, string description, string category)
        {
            AuctionProcessor AP = new AuctionProcessor();

            AP.EditAuction(id, bid, status, currentPrice, maxPrice, endDate, title, description, category);
        }
Exemplo n.º 10
0
        // Create
        public void CreateAuction(decimal bid, int status, decimal currentPrice, decimal maxPrice, DateTime endDate, string title, string description, string category, string ownerId)
        {
            AuctionProcessor AP = new AuctionProcessor();

            AP.CreateAuction(bid, status, currentPrice, maxPrice, endDate, title, description, category, ownerId);
        }
Exemplo n.º 11
0
        // Buyout
        public void BuyoutAuction(int id, decimal maxPrice)
        {
            AuctionProcessor APBuyout = new AuctionProcessor();

            APBuyout.BuyoutAuction(id, maxPrice);
        }