Exemple #1
0
        public async Task CreateBid_WithIncorrectBiddingTime_ShouldReturnFaslse()
        {
            string errorMessagePrefix = "BidService CreateBid() does not work properly.";

            var context = AuctionDbContextInMemory.InitializeContext();

            await SeedData(context);

            this.userService = new UserService(context);
            this.bidService  = new BidService(context, userService);

            var item = new Item
            {
                Id            = "BoneId",
                Name          = "Bone",
                Category      = Category.Other,
                StartingPrice = 13.13M,
                BuyOutPrice   = 34.33M,
                StartTime     = DateTime.UtcNow,
                EndTime       = DateTime.UtcNow.AddMinutes(-1),
                Description   = "Legit",
            };

            context.Items.Add(item);
            context.SaveChanges();

            var dummyUserId = "Hugo";
            var dummyItem   = context.Items.First(x => x.Name == "Bone");
            var result      = await this.bidService.CreateBid(dummyItem, dummyUserId, 20);

            Assert.False(result, errorMessagePrefix);
        }
 public PriceQuotationController(ITransportBidPlanService transportBidPlanServiceParam
                                     , IAdminUnitService adminUnitServiceParam
                                     , IProgramService programServiceParam
                                     , ITransportBidPlanDetailService transportBidPlanDetailServiceParam
                                     , IHubService hubServiceParam
                                     , ITransportBidQuotationService bidQuotationServiceParam
                                     , ITransporterService transporterServiceParam
                                     , IBidService bidServiceParam
                                     , ITransportBidQuotationService transportBidQuotationService
                                     , IBidWinnerService bidWinnerService
                                     , IBusinessProcessService businessProcessService
                                     , IApplicationSettingService applicationSettingService
                                     , ITransportBidQuotationHeaderService transportBidQuotationHeaderService
                                     , ITransportOrderService transportOrderService  )
 {
     this._transportBidPlanService = transportBidPlanServiceParam;
     this._adminUnitService = adminUnitServiceParam;
     this._programService = programServiceParam;
     this._transportBidPlanDetailService = transportBidPlanDetailServiceParam;
     this._hubService = hubServiceParam;
     this._bidQuotationService = bidQuotationServiceParam;
     this._bidService = bidServiceParam;
     this._transporterService = transporterServiceParam;
     this._transportBidQuotationService = transportBidQuotationService;
     this._bidWinnerService = bidWinnerService;
     this._BusinessProcessService = businessProcessService;
     this._transportBidQuotationHeaderService = transportBidQuotationHeaderService;
     this._ApplicationSettingService = applicationSettingService;
     _transportOrderService = transportOrderService;
 }
 public BidController(IBidService bidService, IAuctionService auctionService, IProductService productService, AuctionHubDbContext db, UserManager <User> userManager)
 {
     this.auctionService = auctionService;
     this.bidService     = bidService;
     this.userManager    = userManager;
     this.productService = productService;
 }
Exemple #4
0
 public UserController(IUserService userService, ILotService lotService, IPurchaseService purchaseService, IBidService bidService)
 {
     _userService     = userService;
     _lotService      = lotService;
     _purchaseService = purchaseService;
     _bidService      = bidService;
 }
Exemple #5
0
 public LotController(IUserService userService, ILotService lotService, IProfileService profileService, IBidService bidService)
 {
     this.userService    = userService;
     this.lotService     = lotService;
     this.profileService = profileService;
     this.bidService     = bidService;
 }
Exemple #6
0
 public BidController(DataAccess.Repositories.IAuctionProvider aucProvider, IBidService bidService, IProductService productService, CustomUserManager customUserManager)
 {
     _aucProvider       = aucProvider;
     _bidService        = bidService;
     _productService    = productService;
     _customUserManager = customUserManager;
 }
Exemple #7
0
 public PriceQuotationController(ITransportBidPlanService transportBidPlanServiceParam
                                 , IAdminUnitService adminUnitServiceParam
                                 , IProgramService programServiceParam
                                 , ITransportBidPlanDetailService transportBidPlanDetailServiceParam
                                 , IHubService hubServiceParam
                                 , ITransportBidQuotationService bidQuotationServiceParam
                                 , ITransporterService transporterServiceParam
                                 , IBidService bidServiceParam
                                 , ITransportBidQuotationService transportBidQuotationService
                                 , IBidWinnerService bidWinnerService
                                 , IBusinessProcessService businessProcessService
                                 , IApplicationSettingService applicationSettingService
                                 , ITransportBidQuotationHeaderService transportBidQuotationHeaderService
                                 , ITransportOrderService transportOrderService)
 {
     this._transportBidPlanService       = transportBidPlanServiceParam;
     this._adminUnitService              = adminUnitServiceParam;
     this._programService                = programServiceParam;
     this._transportBidPlanDetailService = transportBidPlanDetailServiceParam;
     this._hubService                         = hubServiceParam;
     this._bidQuotationService                = bidQuotationServiceParam;
     this._bidService                         = bidServiceParam;
     this._transporterService                 = transporterServiceParam;
     this._transportBidQuotationService       = transportBidQuotationService;
     this._bidWinnerService                   = bidWinnerService;
     this._BusinessProcessService             = businessProcessService;
     this._transportBidQuotationHeaderService = transportBidQuotationHeaderService;
     this._ApplicationSettingService          = applicationSettingService;
     _transportOrderService                   = transportOrderService;
 }
Exemple #8
0
 public HomeController(IPostService postService, AppDbContext context, UserManager <AppUser> userManager, ISkillRepo skillRepo, IBidService _bidService)
 {
     _postService     = postService;
     this.context     = context;
     _userManager     = userManager;
     _skillRepo       = skillRepo;
     this._bidService = _bidService;
 }
Exemple #9
0
 public ProfileController(DataAccess.Repositories.IAuctionProvider auctionProvider, CustomUserManager customUserManager, IProductService productService, ICategoriesService categoryService, IBidService bidService)
 {
     _auctionProvider   = auctionProvider;
     _customUserManager = customUserManager;
     _productService    = productService;
     _categoryService   = categoryService;
     _bidService        = bidService;
 }
 public ItemController(IAuctionHouseService auctionHouseService,
                       IItemService itemService,
                       IBidService bidService)
 {
     this.auctionHouseService = auctionHouseService;
     this.itemService         = itemService;
     this.bidService          = bidService;
 }
 public UsersController(ICustomAuthentication authentication, IUserService userService,IBidService bidService,ILotService lotService)
     :base(authentication)
 {
     _customAuthentication = authentication;
     _userService = userService;
     _bidService = bidService;
     _lotService = lotService;
 }
Exemple #12
0
        public BidController(IOrchardServices services, IBidService bidService)
        {
            _services   = services;
            _bidService = bidService;
            _notifier   = _services.Notifier;

            T = NullLocalizer.Instance;
        }
 public BidService(AuctionService auctionService,
                   IEventPublisher eventPublisher,
                   IBidService bidService)
 {
     _auctionService = auctionService;
     _eventPublisher = eventPublisher;
     _bidService     = bidService;
 }
Exemple #14
0
 public LotController(IMapper mapper, ILotService lotService, IBidService bidService, IRepository <Category> categoryRepository, ILotRepository lotRepository)
 {
     _lotRepository      = lotRepository;
     _categoryRepository = categoryRepository;
     _bidService         = bidService;
     _maper      = mapper;
     _lotService = lotService;
 }
 public BidService(AuctionService auctionService,
     IEventPublisher eventPublisher,
     IBidService bidService)
 {
     _auctionService = auctionService;
     _eventPublisher = eventPublisher;
     _bidService = bidService;
 }
 public UsersController(ICustomAuthentication authentication, IUserService userService, IBidService bidService, ILotService lotService)
     : base(authentication)
 {
     _customAuthentication = authentication;
     _userService          = userService;
     _bidService           = bidService;
     _lotService           = lotService;
 }
Exemple #17
0
        //
        // GET: /Procurement/FetchData/

        public FetchDataController(IPaymentRequestService paymentRequestService,
                                   ITransportBidQuotationHeaderService bidQuotationHeader, IBidService bidService, IUserAccountService userAccountService, IBidWinnerService bidWinnerService)
        {
            _paymentRequestService = paymentRequestService;
            _bidService            = bidService;
            _userAccountService    = userAccountService;
            _bidWinnerService      = bidWinnerService;
            _bidQuotationHeader    = bidQuotationHeader;
        }
Exemple #18
0
 public BettingController(
     IBidService bidService,
     IBettingService bettingService,
     UserManager <AppIdentityUser> userManager)
 {
     this.bidService     = bidService;
     this.userManager    = userManager;
     this.bettingService = bettingService;
 }
Exemple #19
0
 public BidTokens(
     IContentManager contentManager,
     IWorkContextAccessor workContextAccessor,
     IBidService bidService) {
     _contentManager = contentManager;
     _workContextAccessor = workContextAccessor;
     _bidService = bidService;
     T = NullLocalizer.Instance;
 }
        public AuctionController(IAuctionService <int> ias, IUserService ius, IBidService ibs, ICategoryAccessor ics)
        {
            auctionService     = ias;
            userService        = ius;
            bidService         = ibs;
            categoriesAccessor = ics;

            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        }
Exemple #21
0
 public AuctionFacade(IUnitOfWorkProvider unitOfWorkProvider, IAuctionService auctionService, ICategoryService categoryService,
                      IAccountService accountService, IBidService bidService)
     : base(unitOfWorkProvider)
 {
     this.auctionService  = auctionService;
     this.categoryService = categoryService;
     this.accountService  = accountService;
     this.bidService      = bidService;
 }
Exemple #22
0
        public BidsPartHandler(IRepository <BidsPartRecord> repository,
                               IBidService bidService)
        {
            _bidService = bidService;

            Filters.Add(StorageFilter.For(repository));

            OnLoading <BidsPart>(LoadBids);
        }
Exemple #23
0
 public AwardJob(IBettingService bettingService, IBidService bidService, IWalletService walletService, IBitcoinWalletService bitcoinWalletService, UserManager <AppIdentityUser> userManager, IEmailSender emailSender)
 {
     this.bettingService       = bettingService;
     this.bidService           = bidService;
     this.walletService        = walletService;
     this.bitcoinWalletService = bitcoinWalletService;
     this.userManager          = userManager;
     this.emailSender          = emailSender;
 }
Exemple #24
0
        public BidsPartHandler(IRepository<BidsPartRecord> repository, 
            IBidService bidService) {

            _bidService = bidService;

            Filters.Add(StorageFilter.For(repository));

            OnLoading<BidsPart>(LoadBids);
        }
Exemple #25
0
 //
 // GET: /Procurement/FetchData/
 public FetchDataController(IPaymentRequestService paymentRequestService,
     ITransportBidQuotationHeaderService bidQuotationHeader,IBidService bidService, IUserAccountService userAccountService, IBidWinnerService bidWinnerService)
 {
     _paymentRequestService = paymentRequestService;
     _bidService = bidService;
     _userAccountService = userAccountService;
     _bidWinnerService = bidWinnerService;
     _bidQuotationHeader = bidQuotationHeader;
 }
Exemple #26
0
 public LotController(ILotService lotService, ICommentService commentService, IBidService bidService,
                      ICategoryService categoryService, IUserService userService)
 {
     _lotService      = lotService;
     _commentService  = commentService;
     _bidService      = bidService;
     _categoryService = categoryService;
     _userService     = userService;
 }
        public FeaturedProductService(IContentManager contentManager, IBidService bidService, IMessageService messageService, IShapeFactory shapeFactory, IScheduledTaskManager scheduledTaskManager, IWorkContextAccessor workContextAccessor) {
            _contentManager = contentManager;
            _bidService = bidService;
            _messageService = messageService;

            Shape = shapeFactory;
            _scheduledTaskManager = scheduledTaskManager;
            _workContextAccessor = workContextAccessor;
            T = NullLocalizer.Instance;
        }
 public UnContractedTransportersController(IBidWinnerService bidWinnerService,
                                           IUserAccountService userAccountService,
                                           IBidService bidService,
                                           IAdminUnitService adminUnitService)
 {
     _bidWinnerService   = bidWinnerService;
     _userAccountService = userAccountService;
     _bidService         = bidService;
     _adminUnitService   = adminUnitService;
 }
Exemple #29
0
 public BidTokens(
     IContentManager contentManager,
     IWorkContextAccessor workContextAccessor,
     IBidService bidService)
 {
     _contentManager      = contentManager;
     _workContextAccessor = workContextAccessor;
     _bidService          = bidService;
     T = NullLocalizer.Instance;
 }
 public UnContractedTransportersController(IBidWinnerService bidWinnerService, 
                                             IUserAccountService userAccountService, 
                                             IBidService bidService,
                                             IAdminUnitService adminUnitService)
 {
     _bidWinnerService = bidWinnerService;
     _userAccountService = userAccountService;
     _bidService = bidService;
     _adminUnitService = adminUnitService;
 }
 public AuctionProcessFacade(IUnitOfWorkProvider unitOfWorkProvider, IAuctionService auctionService,
                             IClosingAuctionService closingAuctionService, IBidService bidService, ICategoryService categoryService, IUserLoginService userLoginService)
     : base(unitOfWorkProvider)
 {
     _auctionService        = auctionService;
     _closingAuctionService = closingAuctionService;
     _bidService            = bidService;
     _categoryService       = categoryService;
     _userLoginService      = userLoginService;
 }
Exemple #32
0
 public BidsController(BidsterDbContext dbContext,
                       UserManager <User> userManager,
                       IBidService bidService,
                       ILogger <BidsController> logger)
 {
     _dbContext   = dbContext;
     _userManager = userManager;
     _bidService  = bidService;
     _logger      = logger;
 }
Exemple #33
0
 public TestController(AppDbContext context,
                       IPostService postService,
                       IBidService bidService,
                       IMessageService messageService,
                       UserManager <AppUser> userManager)
 {
     this.context     = context;
     this.postService = postService;
     this.bidService  = bidService;
 }
Exemple #34
0
 public BidAdministrationController(IBidWinnerService bidWinnerService, IApplicationSettingService applicationSettingService,
                                    IWorkflowStatusService workflowStatusService, IUserAccountService userAccountService,
                                    IBidService bidService, ITransportBidPlanService bidPlanService)
 {
     _bidWinnerService          = bidWinnerService;
     _applicationSettingService = applicationSettingService;
     _workflowStatusService     = workflowStatusService;
     _userAccountService        = userAccountService;
     _bidService     = bidService;
     _bidPlanService = bidPlanService;
 }
 public LotController(ICategoryService categoryService, ISectionService sectionService,
                      ILotService lotService, IUserService userService, ILotImageService lotRequestService,
                      IBidService bidService)
 {
     _sectionService  = sectionService;
     _categoryService = categoryService;
     _lotService      = lotService;
     _userService     = userService;
     _lotImageService = lotRequestService;
     _bidService      = bidService;
 }
 public LotController(ICategoryService categoryService, ISectionService sectionService,
     ILotService lotService, IUserService userService, ILotImageService lotRequestService,
     IBidService bidService)
 {
     _sectionService = sectionService;
     _categoryService = categoryService;
     _lotService = lotService;
     _userService = userService;
     _lotImageService = lotRequestService;
     _bidService = bidService;
 }
 public BidAdministrationController(IBidWinnerService bidWinnerService, IApplicationSettingService applicationSettingService,
                                    IWorkflowStatusService workflowStatusService, IUserAccountService userAccountService,
                                    IBidService bidService, ITransportBidPlanService bidPlanService)
 {
     _bidWinnerService = bidWinnerService;
     _applicationSettingService = applicationSettingService;
     _workflowStatusService = workflowStatusService;
     _userAccountService = userAccountService;
     _bidService = bidService;
     _bidPlanService = bidPlanService;
 }
        public FeaturedProductsController(IFeaturedProductService featuredProductService, IWorkContextAccessor workContextAccessor, IContentManager contentManager, IShapeFactory shapeFactory, IProductService productService, IBidService bidService, IOrchardServices orchardServices) {
            _featuredProductService = featuredProductService;
            _workContextAccessor = workContextAccessor;
            _contentManager = contentManager;

            Shape = shapeFactory;
            _productService = productService;
            _bidService = bidService;
            _orchardServices = orchardServices;

            T = NullLocalizer.Instance;
        }
Exemple #39
0
 public ProjectController(IPostRepo repo,
                          UserManager <AppUser> userManager,
                          AppDbContext context,
                          IBidService bidService,
                          IPostService postService)
 {
     this.repo        = repo;
     this.userManager = userManager;
     this.context     = context;
     this.bidService  = bidService;
     this.postService = postService;
 }
Exemple #40
0
        public void Init()
        {
            _mapper         = new MappingProfile();
            _mockUnitOfWork = new Mock <IUnitOfWork>();
            var     configuration = new MapperConfiguration(cfg => cfg.AddProfile(_mapper));
            IMapper mapper        = new Mapper(configuration);

            _service = new BidService(_mockUnitOfWork.Object, mapper);
            _lots    = new List <Lot>()
            {
                new Lot()
                {
                    Id = 1, InitialPrice = 1, Bids = new List <Bid>()
                    {
                        new Bid {
                            Id = 1, LotId = 1, BidPrice = 21
                        }
                    }
                },
                new Lot()
                {
                    Id = 2, InitialPrice = 1, Bids = new List <Bid>()
                },
                new Lot()
                {
                    Id = 3, InitialPrice = 1, Bids = new List <Bid>()
                }
            };
            _bids = new List <Bid>()
            {
                new Bid()
                {
                    Id = 1, LotId = 1, UserId = 1, UserName = "******", BidPrice = 10, BidDate = DateTime.Now
                },
                new Bid()
                {
                    Id = 2, LotId = 2, UserId = 2, UserName = "******", BidPrice = 15, BidDate = DateTime.Now
                },
                new Bid()
                {
                    Id = 3, LotId = 2, UserId = 2, UserName = "******", BidPrice = 20, BidDate = DateTime.Now
                },
                new Bid()
                {
                    Id = 4, LotId = 2, UserId = 2, UserName = "******", BidPrice = 25, BidDate = DateTime.Now
                },
                new Bid()
                {
                    Id = 5, LotId = 3, UserId = 3, UserName = "******", BidPrice = 30, BidDate = DateTime.Now
                },
            };
        }
 public AuctionController(
     IAuctionService auctionService,
     UserManager <User> userManager,
     IProductService productService,
     ICategoryService categoryService,
     IBidService bids)
 {
     this.auctionService  = auctionService;
     this.userManager     = userManager;
     this.productService  = productService;
     this.categoryService = categoryService;
     this.bids            = bids;
 }
Exemple #42
0
 public BidWinnerController(IBidService bidService, ITransporterService transporterService, IBidWinnerService bidWinnerService,
     IUnitOfWork unitofwork, ITransporterAgreementVersionService transporterAgreementVersionService, IWorkflowStatusService workflowStatusService, 
     IUserAccountService userAccountService)
 {
     _bidService = bidService;
     //_applicationSettingService = applicationSettingService;
     //_bidQuotationService = bidQuotationService;
     this._bidWinnerService = bidWinnerService;
     this._unitofwork = unitofwork;
     this._transporterAgreementVersionService = transporterAgreementVersionService;
     _transporterService = transporterService;
     _workflowStatusService = workflowStatusService;
     _userAccountService = userAccountService;
 }
Exemple #43
0
 public RFQController(ITransportBidPlanService transportBidPlanServiceParam
                                     , IAdminUnitService adminUnitServiceParam
                                     , IProgramService programServiceParam
                                     , ITransportBidPlanDetailService transportBidPlanDetailServiceParam
                                     ,IHubService hubServiceParam
                                     , ITransportBidQuotationService bidQuotationServiceParam
                                     , ITransporterService transporterServiceParam
                                     , IBidService bidServiceParam)
 {
     this._transportBidPlanService = transportBidPlanServiceParam;
         this._adminUnitService = adminUnitServiceParam;
         this._programService = programServiceParam;
         this._transportBidPlanDetailService = transportBidPlanDetailServiceParam;
         this._hubService = hubServiceParam;
         this._bidQuotationService = bidQuotationServiceParam;
         this._bidService = bidServiceParam;
         this._transporterService = transporterServiceParam;
 }
Exemple #44
0
 public HomeController(IReliefRequisitionService reliefRequisitionService,
     hub.IDispatchAllocationService dispatchAllocationService,
     IUserAccountService userAccountService,
     ITransportOrderService transportOrderService,
     ITransportOrderDetailService transportOrderDetailService,
     hub.DispatchService dispatchService,
     hub.DispatchDetailService dispatchDetailService, ISIPCAllocationService sipcAllocationService, IAdminUnitService adminUnitService, IHRDService hrdService, IBidWinnerService bidWinnerService, IBidService bidService)
 {
     this._reliefRequisitionService = reliefRequisitionService;
     _dispatchAllocationService = dispatchAllocationService;
     _userAccountService = userAccountService;
     _transportOrderService = transportOrderService;
     _transportOrderDetailService = transportOrderDetailService;
     _dispatchService = dispatchService;
     _dispatchDetailService = dispatchDetailService;
     _sipcAllocationService = sipcAllocationService;
     _adminUnitService = adminUnitService;
     _hrdService = hrdService;
     _bidWinnerService = bidWinnerService;
     _bidService = bidService;
 }
Exemple #45
0
 public HomeController(IReliefRequisitionService reliefRequisitionService,
     hub.IDispatchAllocationService dispatchAllocationService,
     IUserAccountService userAccountService,
     ITransportOrderService transportOrderService,
     ITransportOrderDetailService transportOrderDetailService,
     hub.DispatchService dispatchService,
     hub.DispatchDetailService dispatchDetailService,
     ISIPCAllocationService sipcAllocationService,
     IAdminUnitService adminUnitService,
     IHRDService hrdService,
     IBidWinnerService bidWinnerService,
     IBidService bidService,
     IHRDDetailService hrdDetailService,
     IRationDetailService rationDetailService,
     IProgramService programService,
     IStockStatusService stockStatusService, IReceiptPlanDetailService receiptPlanDetailService, IDeliveryService deliveryService, IGiftCertificateDetailService giftCertificateDetailService, hub.IReceiptAllocationService receiptAllocationService)
 {
     this._reliefRequisitionService = reliefRequisitionService;
     _dispatchAllocationService = dispatchAllocationService;
     _userAccountService = userAccountService;
     _transportOrderService = transportOrderService;
     _transportOrderDetailService = transportOrderDetailService;
     _dispatchService = dispatchService;
     _dispatchDetailService = dispatchDetailService;
     _sipcAllocationService = sipcAllocationService;
     _adminUnitService = adminUnitService;
     _hrdService = hrdService;
     _bidWinnerService = bidWinnerService;
     _bidService = bidService;
     _hrdDetailService = hrdDetailService;
     _rationDetailService = rationDetailService;
     _programService = programService;
     _stockStatusService = stockStatusService;
     _receiptPlanDetailService = receiptPlanDetailService;
     _deliveryService = deliveryService;
     _giftCertificateDetailService = giftCertificateDetailService;
     _receiptAllocationService = receiptAllocationService;
 }
Exemple #46
0
 public BidController(IBidService bidService, IBidDetailService bidDetailService,
                      IAdminUnitService adminUnitService,
                      IStatusService statusService,
                      ITransportBidPlanService transportBidPlanService,
                      ITransportBidPlanDetailService transportBidPlanDetailService,
                      IApplicationSettingService applicationSettingService,IUserAccountService userAccountService,
                      ITransportBidQuotationService transportBidQuotationService, IBidWinnerService bidWinnerService,
                     ITransporterService transporterService, IHubService hubService,IWorkflowStatusService workflowStatusService)
 {
     _bidService = bidService;
     _bidDetailService = bidDetailService;
     _adminUnitService = adminUnitService;
     _statusService = statusService;
     _transportBidPlanService = transportBidPlanService;
     _transportBidPlanDetailService = transportBidPlanDetailService;
     _applicationSettingService = applicationSettingService;
     _userAccountService = userAccountService;
     _transportBidQuotationService = transportBidQuotationService;
     _bidWinnerService = bidWinnerService;
     _transporterService = transporterService;
     _hubService = hubService;
     _workflowStatusService = workflowStatusService;
 }
Exemple #47
0
 //private readonly ITransportBidQuotationService _priceQuotataion;
 //
 // GET: /Procurement/FetchData/
 public HomeController(IBidService bidService,ITransporterService transporterService, ITransportBidPlanService transportBidPlanService)
 {
     _bidService = bidService;
     _transporterService = transporterService;
     _transportBidPlanService = transportBidPlanService;
 }
 public BidController(IBidService bidService)
 {
     this._bidService = bidService;
 }
        public void SetUp()
        {
            List<Bid> bidTest = new List<Bid>();
              {
                  new Bid() { BidID=1,BidNumber ="PP452",StartDate=new DateTime(2012/10/10),EndDate=new DateTime(2013/12/11),OpeningDate = new DateTime(2013/12/12),StatusID =1};
                  new Bid() { BidID = 2,BidNumber ="AAA123",StartDate = new DateTime(2012 / 10 / 10), EndDate = new DateTime(2013 / 12 / 11),OpeningDate = new DateTime(2012/11/13),StatusID =2};
                  new Bid() { BidID = 3,BidNumber="QW123",StartDate = new DateTime(2012 / 10 / 10), EndDate = new DateTime(2013 / 12 / 11),OpeningDate = new DateTime(2012/05/06),StatusID =1};
              }

             List<AdminUnit> adminUnitTest=new List<AdminUnit>();
              {
                  new AdminUnit() {AdminUnitID = 1, Name = "Afar", NameAM = null, AdminUnitTypeID = 2, ParentID = 1};
              }

            List<BidDetail> bidDetailTest=new List<BidDetail>();
              {
                  new BidDetail()
                      {
                          BidDetailID = 1,
                          BidID = 1,
                          AmountForPSNPProgram = 200,
                          AmountForReliefProgram = 300,
                          BidDocumentPrice = 10,
                          CPO = 1000
                      };
                  new BidDetail()
                  {
                      BidDetailID = 2,
                      BidID = 1,
                      AmountForPSNPProgram = 200,
                      AmountForReliefProgram = 300,
                      BidDocumentPrice = 10,
                      CPO = 1000
                  };
              }

             //Mock the Regional Request Service Using Moq
            Mock<IBidService> mockBidService = new Mock<IBidService>();
            Mock<IBidDetailService> mockBidDetailService=new Mock<IBidDetailService>();
            Mock<IAdminUnitService> mockAdminUnitService=new Mock<IAdminUnitService>();
            //Mock<IStatusService> mockStatusService=new Mock<IStatusService>();
            //Mock<ITransportBidPlanService> mockTransportBidPlanService=new Mock<ITransportBidPlanService>();
            //Mock<ITransportBidPlanDetailService> mockTransportBidPlanDetailService = new Mock<ITransportBidPlanDetailService>();

            mockBidService.Setup(m => m.GetAllBid()).Returns(bidTest);
            mockAdminUnitService.Setup(m => m.FindBy(au => au.AdminUnitTypeID==2)).Returns(adminUnitTest);
            mockBidDetailService.Setup(m => m.GetAllBidDetail()).Returns(bidDetailTest);

            this.MockAdminUnitService = mockAdminUnitService.Object;
            this.MockBidService = mockBidService.Object;
            this.MockBidDetail = mockBidDetailService.Object;

            var userAccountService = new Mock<IUserAccountService>();
            userAccountService.Setup(t => t.GetUserInfo(It.IsAny<string>())).Returns(new UserInfo()
            {
                UserName = "******",
                DatePreference = "en"
            });
            var fakeContext = new Mock<HttpContextBase>();
            var identity = new GenericIdentity("User");
            var principal = new GenericPrincipal(identity, null);
            fakeContext.Setup(t => t.User).Returns(principal);
            var controllerContext = new Mock<ControllerContext>();
            controllerContext.Setup(t => t.HttpContext).Returns(fakeContext.Object);

            var transportBidQuotationService = new Mock<ITransportBidQuotationService>();
            transportBidQuotationService.Setup(m => m.GetAllTransportBidQuotation()).Returns(new List <TransportBidQuotation>
                {
                    new TransportBidQuotation() {BidID = 1,DestinationID = 1,TransportBidQuotationID = 1}
                });

             var bidWinner = new List<BidWinner>
            {
                new BidWinner
                    {
                        BidWinnerID = 1,
                        BidID = 1,
                        DestinationID = 23,
                        SourceID = 4,
                        Tariff = 12,
                        Position = 1,
                        Bid = new Bid
                            {
                                BidID = 1,
                                StartDate = new DateTime(12/12/2004),
                                EndDate = new DateTime(12/12/2005),
                                TransportBidPlanID = 1
                            }

                    }
            };
            var bidWinnerService = new Mock<IBidWinnerService>();
            bidWinnerService.Setup(m => m.GetAllBidWinner()).Returns(bidWinner);

             var transporter = new List<Transporter>()
                                  {
                                      new Transporter()
                                          {
                                                          TransporterID = 1,
                                                          Name = "Bert",
                                                          Region = 4,
                                                          SubCity = "Arada",
                                                          Zone = 1,
                                                          MobileNo = "09123786554",
                                                          Capital = 20000
                                          }
                                  };

            var transporterService = new Mock<ITransporterService>();
            transporterService.Setup(m => m.GetAllTransporter()).Returns(transporter);
            var hub = new List<Hub>
                {
                    new Hub() {HubID = 1, Name = "Adama", HubOwnerID = 1},
                    new Hub() {HubID = 2, Name = "Dire Dawa", HubOwnerID = 1}
                };

             var workFlowStatus = new List<WorkflowStatus>
                {
                     new WorkflowStatus {
                                          Description = "Draft",
                                          StatusID = 1,
                                          WorkflowID = 8
                                        },
                                  new WorkflowStatus
                                      {
                                          Description = "Approved",
                                          StatusID = 2,
                                          WorkflowID = 8
                                      },
                                  new WorkflowStatus
                                      {
                                          Description = "Signed",
                                          StatusID = 3,
                                          WorkflowID = 8
                                      },
                                          new WorkflowStatus
                                      {
                                          Description = "Disqualified",
                                          StatusID = 4,
                                          WorkflowID = 8
                                      }
                };
             var workFlowStatusService = new Mock<IWorkflowStatusService>();

            var hubService = new Mock<IHubService>();
            hubService.Setup(m => m.GetAllHub()).Returns(hub);
            _bidController = new BidController(MockBidService, MockBidDetail, MockAdminUnitService, MockStatusService,
                                            MockTransportBidPlanService,MockTransportBidPlanDetailService,MockApplicationSetting,
                                            userAccountService.Object,transportBidQuotationService.Object,bidWinnerService.Object,
                                            transporterService.Object, hubService.Object, workFlowStatusService.Object);
            _bidController.ControllerContext = controllerContext.Object;
        }
 //
 // GET: /Procurement/FetchData/
 public FetchDataController(IPaymentRequestService paymentRequestService, IBidService bidService)
 {
     _paymentRequestService = paymentRequestService;
     _bidService = bidService;
 }