Esempio n. 1
0
        public void GetBuildResult_WithoutBuildConfiguration_IsNull()
        {
            BuildArtifacts.Store(BuildPipelineResult.Success(m_BuildPipeline, m_BuildConfiguration), new IBuildArtifact[] { });
            var result = BuildArtifacts.GetBuildResult(null);

            Assert.That(result, Is.Null);
        }
        public void GetBuildArtifact_ReturnNull_WithWrongType()
        {
            var result = BuildPipelineResult.Success(m_BuildPipeline, m_BuildSettings);

            BuildArtifacts.Store(result, new[] { new TestArtifacts() });
            Assert.That(BuildArtifacts.GetBuildArtifact <TestArtifacts2>(m_BuildSettings), Is.Null);
        }
        public void GetBuildArtifact()
        {
            var result = BuildPipelineResult.Success(m_BuildPipeline, m_BuildSettings);

            BuildArtifacts.Store(result, new[] { new TestArtifacts() });
            Assert.That(BuildArtifacts.GetBuildArtifact <TestArtifacts>(m_BuildSettings), Is.Not.Null);
        }
Esempio n. 4
0
        public void GetBuildArtifact_WithBuildArtifactTypeNotFound_IsNull()
        {
            var result = BuildPipelineResult.Success(m_BuildPipeline, m_BuildConfiguration);

            BuildArtifacts.Store(result, new[] { new TestArtifactA() });
            Assert.That(File.Exists(BuildArtifacts.GetArtifactPath(m_BuildConfiguration)), Is.True);
            Assert.That(BuildArtifacts.GetBuildArtifact <TestArtifactB>(m_BuildConfiguration), Is.Null);
        }
Esempio n. 5
0
        public void GetBuildArtifact_WithoutBuildArtifacts_IsNull()
        {
            var result = BuildPipelineResult.Success(m_BuildPipeline, m_BuildConfiguration);

            BuildArtifacts.Store(result, new IBuildArtifact[] { });
            Assert.That(File.Exists(BuildArtifacts.GetArtifactPath(m_BuildConfiguration)), Is.True);
            Assert.That(BuildArtifacts.GetBuildArtifact <TestArtifactA>(m_BuildConfiguration), Is.Null);
        }
Esempio n. 6
0
        public void GetBuildResult_IsValid()
        {
            BuildArtifacts.Store(BuildPipelineResult.Success(m_BuildPipeline, m_BuildConfiguration), new IBuildArtifact[] { });
            var result = BuildArtifacts.GetBuildResult(m_BuildConfiguration);

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Succeeded, Is.True);
        }
        public void GetBuildResult()
        {
            BuildArtifacts.Store(BuildPipelineResult.Success(m_BuildPipeline, m_BuildSettings), new IBuildArtifact[] { });

            var result = BuildArtifacts.GetBuildResult(m_BuildSettings);

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Succeeded, Is.True);
        }
Esempio n. 8
0
        public void GetBuildArtifact_FileDeleted_IsNull()
        {
            var result = BuildPipelineResult.Success(m_BuildPipeline, m_BuildConfiguration);

            BuildArtifacts.Store(result, new[] { new TestArtifactA() });

            var artifactPath = BuildArtifacts.GetArtifactPath(m_BuildConfiguration);

            Assert.That(File.Exists(artifactPath), Is.True);

            File.Delete(artifactPath);
            Assert.That(BuildArtifacts.GetBuildArtifact <TestArtifactA>(m_BuildConfiguration), Is.Null);
        }
        public void LogResult_SupportFormattingCharacters()
        {
            var pipeline = BuildPipeline.CreateInstance();
            var config   = BuildConfiguration.CreateInstance();

            var resultSuccess = BuildPipelineResult.Success(pipeline, config);

            Assert.DoesNotThrow(() =>
            {
                LogAssert.Expect(LogType.Log, new Regex(@"Build succeeded after .+\."));
                resultSuccess.LogResult();
            });

            var resultFailure = BuildPipelineResult.Failure(pipeline, config, @"{}{{}}{0}{s}%s%%\s±@£¢¤¬¦²³¼½¾");

            Assert.DoesNotThrow(() =>
            {
                LogAssert.Expect(LogType.Error, new Regex(@"Build failed after .+\.\n.+"));
                resultFailure.LogResult();
            });
        }
Esempio n. 10
0
        public void Store_WithoutBuildArtifactsArray_Throws()
        {
            var result = BuildPipelineResult.Success(m_BuildPipeline, m_BuildConfiguration);

            Assert.Throws <ArgumentNullException>(() => BuildArtifacts.Store(result, null));
        }
        public void Store_Throws_WhenNullArtifactsPassed()
        {
            var result = BuildPipelineResult.Success(m_BuildPipeline, m_BuildSettings);

            Assert.Throws <ArgumentNullException>(() => BuildArtifacts.Store(result, null));
        }