public void HandledException()
        {
            CurrentUnitOfWork.ShouldNotBeNull();
            CurrentUnitOfWork.Options.IsTransactional.ShouldBeTrue();

            throw new UserFriendlyException("This is a sample exception!");
        }
        public void ExceptionOnComplete()
        {
            CurrentUnitOfWork.ShouldNotBeNull();
            CurrentUnitOfWork.Options.IsTransactional.ShouldBeFalse();

            _testUnitOfWorkConfig.ThrowExceptionOnComplete = true;
        }
        public ActionResult ActionRequiresUowPost()
        {
            CurrentUnitOfWork.ShouldNotBeNull();
            CurrentUnitOfWork.Options.IsTransactional.ShouldBeTrue();

            return(Content("OK"));
        }
예제 #4
0
        public IActionResult OnGetRequiresUow()
        {
            CurrentUnitOfWork.ShouldNotBeNull();
            CurrentUnitOfWork.Options.IsTransactional.ShouldBeFalse();

            return(Content("OK"));
        }
예제 #5
0
        public ObjectResult OnGetExceptionOnComplete()
        {
            CurrentUnitOfWork.ShouldNotBeNull();
            CurrentUnitOfWork.Options.IsTransactional.ShouldBeFalse();

            _testUnitOfWorkConfig.ThrowExceptionOnComplete = true;

            //Prevent rendering of pages.
            return(new ObjectResult(""));
        }
 public virtual void DoIt2 <T>()
 {
     CurrentUnitOfWork.ShouldNotBeNull();
 }
 public void DoIt <T>()
 {
     CurrentUnitOfWork.ShouldNotBeNull();
 }