Exemple #1
0
 protected void Application_Start()
 {
     GlobalConfiguration.Configure(WebApiConfig.Register);
     GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
     GlobalConfiguration.Configuration.Formatters.JsonFormatter.UseDataContractJsonSerializer       = false;
     AutoMapperServicesConfiguration.Configure();
 }
Exemple #2
0
 public void Init()
 {
     _mockUnitWork = new Mock <IUnitOfWork>();
     _service      = new BidsService(_mockUnitWork.Object);
     _lots         = new List <Lot>()
     {
         new Lot()
         {
             LotId = 1, InitialPrice = 1
         },
         new Lot()
         {
             LotId = 2, InitialPrice = 1
         },
         new Lot()
         {
             LotId = 3, InitialPrice = 1
         }
     };
     _bids = new List <Bid>()
     {
         new Bid()
         {
             BidId = 1, LotId = 1, PlacedUserId = 1, Price = 10, Date = DateTime.Now, Lot = new Lot(), PlacedUser = new UserProfile()
         },
         new Bid()
         {
             BidId = 2, LotId = 2, PlacedUserId = 2, Price = 15, Date = DateTime.Now, Lot = new Lot(), PlacedUser = new UserProfile()
         },
         new Bid()
         {
             BidId = 3, LotId = 2, PlacedUserId = 2, Price = 20, Date = DateTime.Now, Lot = new Lot(), PlacedUser = new UserProfile()
         },
         new Bid()
         {
             BidId = 4, LotId = 2, PlacedUserId = 2, Price = 25, Date = DateTime.Now, Lot = new Lot(), PlacedUser = new UserProfile()
         },
         new Bid()
         {
             BidId = 5, LotId = 3, PlacedUserId = 3, Price = 30, Date = DateTime.Now, Lot = new Lot(), PlacedUser = new UserProfile()
         },
     };
     _users = new List <UserProfile>()
     {
         new UserProfile()
         {
             UserProfileId = 1, Name = "User"
         },
         new UserProfile()
         {
             UserProfileId = 2, Name = "User1"
         },
         new UserProfile()
         {
             UserProfileId = 3, Name = "User2"
         }
     };
     AutoMapperServicesConfiguration.Configure();
 }