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); }
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); }
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)); }
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); }