public UpdateOpeningDateShuld()
 {
     AuctionFactory             = new AuctionFactory();
     AuctionStrategyFactory     = new AuctionStrategyFactory();
     _updateOpeningDateStrategy = AuctionStrategyFactory.Make <UpdateOpeningParameter>(StrategyTypeEnum.UpdateOpeningDate);
     Sut = AuctionFactory.Make(AuctionTypeEnum.Complete);
 }
Esempio n. 2
0
        private void AddOneRoundAuctionInAuction(RoundAuction roundAuction)
        {
            var addRoundAuctionStrategy = AuctionStrategyFactory.Make <AddRoundAuctionParameter>(StrategyTypeEnum.AddRound);
            var parameter = new AddRoundAuctionParameter(roundAuction);

            addRoundAuctionStrategy.Execute(Auction, parameter);
        }
Esempio n. 3
0
 public DecoratorAuctionMilestoneStrategyTest()
 {
     _auctionsDecoratorsFactory = new AuctionsMilestonesDecoratorsFactory();
     AuctionFactory             = new AuctionFactory();
     Auction = AuctionFactory.Make(AuctionTypeEnum.Complete);
     _sut    = _auctionsDecoratorsFactory.Make <UpdateOpeningParameter>(DecoratorsEnum.DecoratorAuctionMilestone);
     _updateOpeningDateStrategy = AuctionStrategyFactory.Make <UpdateOpeningParameter>(StrategyTypeEnum.UpdateOpeningDate);
 }
Esempio n. 4
0
 public UpdateProvidersStrategyTests()
 {
     _originalListOfProviders = new List <Provider> {
         _provider1, _provider2, _provider3
     };
     _auctionStatusFactoryMock      = new Mock <IAuctionStatusFactory>();
     _statusAuctionMock             = new Mock <StatusAuction <Auction> >(Auction);
     _roundAuctionStatusFactoryMock = new Mock <IRoundAuctionStatusFactory>();
     _roundAuctionsStatusMock       = new Mock <Entities.RoundAuctionsStatus>(Auction);
     Sut     = AuctionStrategyFactory.Make <UpdateProviderParameter>(StrategyTypeEnum.UpdateProvider);
     Auction = new Auction(_auctionStatusFactory, _roundAuctionStatusFactory, AuctionStatusTypeEnum.New);
 }
 public AddRoundAuctionStrategyTests()
 {
     Sut = AuctionStrategyFactory.Make <AddRoundAuctionParameter>(StrategyTypeEnum.AddRound);
 }
Esempio n. 6
0
 public UpdateOpeningDateStrategyTests()
 {
     Sut = AuctionStrategyFactory.Make <UpdateOpeningParameter>(StrategyTypeEnum.UpdateOpeningDate);
 }
Esempio n. 7
0
 public DeleteRoundAuctionStrategyTests()
 {
     Sut = AuctionStrategyFactory.Make <DeleteRoundAuctionParameter>(StrategyTypeEnum.DeleteRound);
 }
Esempio n. 8
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var auctionStrategyFactory = new AuctionStrategyFactory();

            var updateProviderStrategy =
                auctionStrategyFactory.Make <UpdateProviderParameter>(StrategyTypeEnum.UpdateProvider);

            var updateParameter =
                new UpdateProviderParameter(new Providers(new List <Provider> {
                new Provider {
                    Name = "Juan"
                }
            }));


            var auctionStatusFactory      = new AuctionStatusFactory();
            var roundAuctionStatusFactory = new RoundAuctionStatusFactory();
            var auction = new Auction(auctionStatusFactory, roundAuctionStatusFactory, AuctionStatusTypeEnum.New);

            auction.ChangeStatus(auctionStatusFactory.Make(AuctionStatusTypeEnum.Draft, auction));

            auction.Update(updateProviderStrategy, updateParameter);

            var newRound1 = new RoundAuction(auction);
            var newRound2 = new RoundAuction(auction);
            var newRound3 = new RoundAuction(auction);


            //Round Auction

            var addRoundAuctionStrategy =
                auctionStrategyFactory.Make <AddRoundAuctionParameter>(StrategyTypeEnum.AddRound);

            var addRoundAuctionParameters = new AddRoundAuctionParameter(newRound1);

            auction.Update(addRoundAuctionStrategy, addRoundAuctionParameters);


            var addRoundAuctionParameters2 = new AddRoundAuctionParameter(newRound2);

            auction.Update(addRoundAuctionStrategy, addRoundAuctionParameters2);


            var deleteRoundAuctionStrategy =
                auctionStrategyFactory.Make <DeleteRoundAuctionParameter>(StrategyTypeEnum.DeleteRound);
            var deleteRoundAuctionParameters = new DeleteRoundAuctionParameter(newRound1);

            auction.Update(deleteRoundAuctionStrategy, deleteRoundAuctionParameters);

            var deleteRoundAuctionParameters3 = new DeleteRoundAuctionParameter(newRound1);

            auction.Update(deleteRoundAuctionStrategy, deleteRoundAuctionParameters3);


            var deleteRoundAuctionParameters2 = new DeleteRoundAuctionParameter(newRound2);

            auction.Update(deleteRoundAuctionStrategy, deleteRoundAuctionParameters2);


            var auctionsDecoratorsFactory = new AuctionsMilestoneDecoratorsChainOfResponsibilityFactory();

            //var decorator = auctionsDecoratorsFactory.Make<AuctionMilestoneStrategyParameter>(DecoratorsEnum.DecoratorAuctionMilestone);



            //decorator.SetStrategy()
        }