Пример #1
0
 public void AddBid(Bid bid)
 {
     _bidDb.Add(bid);
 }
Пример #2
0
        private void Test()
        {
            _auctionMock = new Mock<DbSet<Auction>>();
            _lotMock = new Mock<DbSet<Lot>>();
            _artPieceMock = new Mock<DbSet<ArtPiece>>();
            _mockContext = new Mock<AuctionContext>();

            _mockContext.Setup(m => m.Auctions).Returns(_auctionMock.Object);
            _mockContext.Setup(m => m.Lots).Returns(_lotMock.Object);
            _mockContext.Setup(m => m.ArtPieces).Returns(_artPieceMock.Object);

            _artPiece = new ArtPiece() {
                ArtPieceId = 1,
                Artist = "Anders",
                Description = "Hej",
                Name = "Mona Lisa",
                Number = 1001,
                PurchasePrice = 10
            };

            _lot = new Lot() {
                LotId = 1,
                MinBid = 20,
                Position = 1,
                ArtPiece = _artPiece
            };

            _auction = new Auction {
                AuctionId = 1,
                AuctionName = "Test Auction",
                CreationDate = DateTime.Now,
                LotDuration = TimeSpan.FromMinutes(30),
                Multiplier = 3,
                Status = Status.Ready,
                Lots = new List<Lot>() { _lot }
            };

            _bidArtPiece = new ArtPiece() {
                ArtPieceId = 2,
                Artist = "Anders",
                Description = "Hej",
                Name = "Mona Lisa",
                Number = 1001,
                PurchasePrice = 10
            };

            Bid bid = new Bid() {
                Amount = 20,
                Bidder = new Member() { MemberId = 1},
                BidId = 1
            };

            _bidLot = new Lot() {
                LotId = 2,
                MinBid = 20,
                Position = 1,
                ArtPiece = _bidArtPiece,
                Bids = new List<Bid>() { bid}
            };

            _bidAuction = new Auction {
                AuctionId = 5,
                AuctionName = "Test Auction",
                CreationDate = DateTime.Now,
                LotDuration = TimeSpan.FromMinutes(30),
                Multiplier = 3,
                Status = Status.Ready,
                Lots = new List<Lot>() { _bidLot }
            };

            _auctionMock.AddQueryData(new List<Auction> { _auction, _bidAuction }.AsQueryable());
        }
Пример #3
0
 public void AddBid(Bid bid)
 {
     _bidService.AddBid(bid);
 }