コード例 #1
0
        public void Verify_that_DeploymentService_Execute_returns_unsuccessful_result_when_SqlExecutionService_fails_and_does_not_call_FileService()
        {
            _mockJobConfigurationParser.Setup(x => x.Parse(It.IsAny <JobConfiguration>()));
            _mockSqlScriptProvider.Setup(x => x.Build(It.IsAny <JobConfiguration>()));
            _mockSqlExecutionService.Setup(
                x => x.Execute(It.IsAny <string>(), It.IsAny <List <SqlScript> >(), It.IsAny <bool>()))
            .Returns(new DeploymentResult(new Exception("Test"), false, typeof(SqlExecutionService)));


            _deploymentService.Execute(new DeploymentConfiguration());

            _mockJobConfigurationParser.Verify(x => x.Parse(It.IsAny <JobConfiguration>()), Times.Once());
            _mockSqlScriptProvider.Verify(x => x.Build(It.IsAny <JobConfiguration>()), Times.Once);
            _mockSqlExecutionService.Verify(x => x.Execute(It.IsAny <string>(), It.IsAny <List <SqlScript> >(), It.IsAny <bool>()), Times.Once);
            _mockFileService.Verify(x => x.Execute(It.IsAny <JobConfiguration>()), Times.Never);
        }
コード例 #2
0
 /// <summary>
 /// Will deploy the configuration
 /// </summary>
 /// <returns>DeploymentResult</returns>
 public DeploymentResult Deploy()
 {
     return(DeploymentService.Execute(Configuration));
 }