public void GivenAId_WhenASubDocTypeIsRequested_ThenASubDocTypeIsReturned() { _subDocTypeRepository.Setup(a => a.GetSubDocType(It.IsAny <int>())).Returns(new SubDocType()); SubDocType subDocType = _subDocTypeService.GetSubDocType(It.IsAny <int>()); subDocType.Should().NotBeNull(); }
public void GivenSubDocTypeCode_WhenASubDocTypeIsRequested_ThenASubDocTypeIsReturned() { _subDocTypeRepository.Setup(a => a.GetSubDocType(It.IsAny <string>())).Returns(new SubDocType()); SubDocType subDocType = _subDocTypeService.GetSubDocType(It.IsAny <string>()); _subDocTypeRepository.Verify(a => a.GetSubDocType(It.IsAny <string>()), Times.Once()); subDocType.Should().NotBeNull(); }
public void WhenIUpdateASubDocType_ThenTheSubDocTypeIsUpdated() { _subDocTypeRepository.Create(_subDocType1); SubDocType subDocType = _subDocTypeRepository.Entities.Where(p => p.Code == "code 1").FirstOrDefault(); _subDocTypeRepository.Update(subDocType.Id, "new code", "description 1"); subDocType = _subDocTypeRepository.Entities.Where(p => p.Code == "new code").FirstOrDefault(); subDocType.Should().NotBeNull(); }