public void TheColumnIsFoundAndItIsReturned()
        {
            var methodGroup = new RetrieveColumnInformationByColumnIdMethodGroup(_queryMethod, _sessionMethod);

            _columnControllerShadow.
                RetrieveColumnInformationByColumnId(ColumnId, methodGroup)
                .Data
                .Should()
                .Be(_informationResult);
        }
        public JsonResult RetrieveColumnInformationByColumnId(int columnId, RetrieveColumnInformationByColumnIdMethodGroup methodGroup)
        {
            var columnInformation =
                new WithSession(methodGroup.SessionMethod)
                    .ReturnResult(session =>
                            {
                                var result = methodGroup.RetrieveColumnInformationById(columnId, session);
                                GuardClause.IfNullThrowArgumentException(result, "ColumnControllerShadow.");

                                return result;
                            });

            return new JsonResult { Data = columnInformation };
        }
 public void TheColumnQueryIsCalledCorrectly()
 {
     var methodGroup = new RetrieveColumnInformationByColumnIdMethodGroup((columnId, session) => { if (columnId == ColumnId && session == _session) throw new MethodAccessException(); return null; }, _sessionMethod);
     AssertionExtensions.ShouldThrow<MethodAccessException>(() => _columnControllerShadow.RetrieveColumnInformationByColumnId(ColumnId, methodGroup));
 }
 public void TheColumnDoesNotExistSoAnExceptionIsThrown()
 {
     var methodGroup = new RetrieveColumnInformationByColumnIdMethodGroup((x, session) => null, _sessionMethod);
     AssertionExtensions.ShouldThrow<ArgumentException>(() => _columnControllerShadow.RetrieveColumnInformationByColumnId(ColumnId, methodGroup));
 }
 public void AndANewSessionIsCreated()
 {
     var methodGroup = new RetrieveColumnInformationByColumnIdMethodGroup(_queryMethod, () => { throw new MethodAccessException(); });
     AssertionExtensions.ShouldThrow<MethodAccessException>(() => _columnControllerShadow.RetrieveColumnInformationByColumnId(ColumnId, methodGroup));
 }