Inheritance: IBuildOutputPackagingService
コード例 #1
0
        public void Constructor_AllParametersAreSet_ObjectIsInstantiated()
        {
            // Arrange
            var prepackagingService = new Mock<IPrepackagingService>();
            var packagingService = new Mock<IPackagingService>();

            // Act
            var buildOutputPackagingService = new BuildOutputPackagingService(prepackagingService.Object, packagingService.Object);

            // Assert
            Assert.IsNotNull(buildOutputPackagingService);
        }
コード例 #2
0
        public void Package_BuildOutputFolderPathParameterIsInvalid_FailureResultIsReturned(string buildOutputFolderPath)
        {
            // Arrange
            var prepackagingService = new Mock<IPrepackagingService>();
            var packagingService = new Mock<IPackagingService>();
            var buildOutputPackagingService = new BuildOutputPackagingService(prepackagingService.Object, packagingService.Object);

            // Act
            var result = buildOutputPackagingService.Package(buildOutputFolderPath);

            // Assert
            Assert.AreEqual(ServiceResultType.Failure, result.Status);
        }
コード例 #3
0
        public void Package_PackagingFails_FailureResultContainsBuildOutputFolderPath()
        {
            // Arrange
            string buildOutputFolderPath = "C:\\built-output";

            var prepackagingService = new Mock<IPrepackagingService>();
            prepackagingService.Setup(p => p.Prepackage(It.IsAny<string>())).Returns(new SuccessResult());

            var packagingService = new Mock<IPackagingService>();
            packagingService.Setup(p => p.Package()).Returns(new FailureResult());

            var buildOutputPackagingService = new BuildOutputPackagingService(prepackagingService.Object, packagingService.Object);

            // Act
            var result = buildOutputPackagingService.Package(buildOutputFolderPath);

            // Assert
            Assert.IsTrue(result.Message.Contains(buildOutputFolderPath));
        }
コード例 #4
0
        public void Package_PackagingFails_FailureResultIsReturned()
        {
            // Arrange
            string buildOutputFolderPath = "C:\\built-output";

            var prepackagingService = new Mock<IPrepackagingService>();
            prepackagingService.Setup(p => p.Prepackage(It.IsAny<string>())).Returns(new SuccessResult());

            var packagingService = new Mock<IPackagingService>();
            packagingService.Setup(p => p.Package()).Returns(new FailureResult());

            var buildOutputPackagingService = new BuildOutputPackagingService(prepackagingService.Object, packagingService.Object);

            // Act
            var result = buildOutputPackagingService.Package(buildOutputFolderPath);

            // Assert
            Assert.AreEqual(ServiceResultType.Failure, result.Status);
        }