コード例 #1
0
        public async Task PublishArtifacts_ItemNotExists_ThrowsResourceNotFoundException()
        {
            _versionControlRepository.Setup(
                a => a.GetDiscardPublishStates(It.IsAny <int>(), It.IsAny <IEnumerable <int> >(), It.IsAny <IDbTransaction>()))
            .ReturnsAsync(new List <SqlDiscardPublishState>
            {
                new SqlDiscardPublishState
                {
                    NotExist = true
                }
            });
            var versionControlService = new VersionControlService(
                _versionControlRepository.Object,
                _publishRepository.Object,
                _revisionRepository.Object,
                _sqlHelper.Object);

            var publishParameters = new PublishParameters {
                ArtifactIds = new List <int>()
                {
                    1
                }
            };

            await versionControlService.PublishArtifacts(publishParameters);
        }
コード例 #2
0
        public async Task PublishArtifacts_EmptyListIds_ThrowsBadRequestException()
        {
            var versionControlService = new VersionControlService(
                _versionControlRepository.Object,
                _publishRepository.Object,
                _revisionRepository.Object,
                _sqlHelper.Object);

            var publishParameters = new PublishParameters {
                ArtifactIds = new List <int>()
            };

            await versionControlService.PublishArtifacts(publishParameters);
        }
コード例 #3
0
        public async Task PublishArtifacts_ItemCountMismatch_ThrowsBadRequestException()
        {
            _versionControlRepository.Setup(
                a => a.GetDiscardPublishStates(It.IsAny <int>(), It.IsAny <IEnumerable <int> >(), It.IsAny <IDbTransaction>()))
            .ReturnsAsync(new List <SqlDiscardPublishState>
            {
                new SqlDiscardPublishState()
            });
            var versionControlService = new VersionControlService(
                _versionControlRepository.Object,
                _publishRepository.Object,
                _revisionRepository.Object,
                _sqlHelper.Object);

            var publishParameters = new PublishParameters {
                ArtifactIds = new List <int>()
                {
                    1, 2, 3
                }
            };

            await versionControlService.PublishArtifacts(publishParameters);
        }