Esempio n. 1
0
        public void GivenValidData_WhenIUpdateASubDocType_ThenTheSubDocTypeisUpdated()
        {
            var _subDocTypeService = new SubDocTypeService(_subDocTypeRepository.Object);

            _subDocTypeService.Update(1, "code", "description");
            _subDocTypeRepository.Verify(p => p.Update(1, "code", "description"));
        }
Esempio n. 2
0
        public void GivenValidData_AndAnUnavailableDatabase_WhenIUpdateAnSubDocType_ThenAnUnityExceptionIsThrown()
        {
            _subDocTypeRepository.Setup(p => p.Update(It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>()))
            .Throws <Exception>();
            var _subDocTypeService = new SubDocTypeService(_subDocTypeRepository.Object);

            Action act = () => _subDocTypeService.Update(It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>());

            act.ShouldThrow <UnityException>();
        }