Exemplo n.º 1
0
        public void GivenAnId_WhenASubDocTypeIsRequested_AndTheDataBaseIsUnavailable_ThenAUnityExceptionIsThrown()
        {
            _subDocTypeRepository.Setup(a => a.GetSubDocType((It.IsAny <int>()))).Throws <Exception>();

            Action act = () => _subDocTypeService.GetSubDocType(It.IsAny <int>());

            act.ShouldThrow <UnityException>();
        }
Exemplo n.º 2
0
        public virtual ActionResult Edit(int subDocTypeId)
        {
            SubDocType subDocType = _subDocTypeService.GetSubDocType(subDocTypeId);
            var        docTypes   = _docTypeService.GetDocTypes();

            var model = new EditSubDocTypeViewModel()
            {
                Code         = subDocType.Code,
                Description  = subDocType.Description,
                SubDocTypeId = subDocType.Id
            };

            model.AddDocTypes(docTypes);

            return(View(model));
        }