コード例 #1
0
        public void DoCheckOfferor_ShouldThrow()
        {
            PersonOfferor offeror        = null;
            var           auctionServcie = InstanceHelper.GetAuctionService(null);

            Assert.ThrowsAny <Exception>(() => CanOfferorEndAuctionCheck.DoCheck(offeror, auctionServcie));
        }
コード例 #2
0
        public void DoCheck_ShouldBeValid()
        {
            var offeror        = InstanceHelper.GetPersonOfferor();
            var auctionServcie = InstanceHelper.GetAuctionService(null);

            // If throws error, this test will fail
            CanOfferorEndAuctionCheck.DoCheck(offeror, auctionServcie);
            Assert.True(true);
        }
コード例 #3
0
        /// <summary>
        /// Ends the auction.
        /// </summary>
        /// <param name="offeror">The offer person.</param>
        public void EndAuction(PersonOfferor offeror)
        {
            try
            {
                this.Auction.ValidateObject();
                CanOfferorEndAuctionCheck.DoCheck(offeror, this);
            }
            catch (Exception e)
            {
                throw e;
            }

            this.IsActive        = false;
            this.Auction.EndDate = DateTime.Now;
            this.HadEnded        = true;
        }