protected override void HandleLotAction(LotEntity lot)
        {
            lot.StartBid   = decimal.Parse(StartBid);
            lot.CurrentBid = lot.StartBid;

            lot.DateCreated  = DateTime.Now;
            lot.DateToExpire = DateTime.Now.AddDays(SelectedDaysCount.DaysCount);
            lot.OwnerId      = Session.User.Id;
            lot.IsActive     = true;

            LotService.AddLot(lot);
            View.OnLotAction(lot, FormMode.Add);
        }
        public void AddLot_Creates_Lot_With_New_Instrument_Symbol()
        {
            //arrange.
            var symbol        = "sym1";
            var purchaseDate  = new DateTime(2000, 1, 2);
            var purchasePrice = 123.45m;
            var notes         = "notes 123";

            _instrumentRepository.Setup(r => r.GetById(symbol))
            .Returns(() => null)
            .Verifiable();

            //act.
            _sut.AddLot(symbol, purchaseDate, purchasePrice, notes);

            //assert.
            _instrumentRepository.Verify();

            Lot createdLot = null;

            Predicate <Lot> hasAllInfo = lot =>
                                         (createdLot = lot) == lot &&
                                         lot.Id != Guid.Empty &&
                                         lot.InstrumentInfo != null &&
                                         lot.InstrumentInfo.Symbol == symbol &&
                                         lot.InstrumentInfo.CurrentPrice == purchasePrice &&
                                         lot.PurchaseDate == purchaseDate &&
                                         lot.PurchasePrice == purchasePrice;

            Predicate <object> isAboutLotCreation = evt =>
                                                    evt is LotWasCreatedDomainEvent createdEvt &&
                                                    createdLot != null &&
                                                    createdEvt.LotId == createdLot.Id;

            _lotRepository.Verify(r => r.Add(It.Is <Lot>(lot => hasAllInfo(lot))), Times.Once);
            _eventManager.Verify(m => m.Raise(It.Is <object>(evt => isAboutLotCreation(evt))), Times.Once);
        }