public void StartDeployment_WhenDeploymentTaskIsNull_ThrowsArgumentNullException() { var projectInfoRepositoryFake = new Mock <IProjectInfoRepository>(MockBehavior.Loose); var environmentInfoRepositoryFake = new Mock <IEnvironmentInfoRepository>(MockBehavior.Loose); var pipeline = new DeploymentPipeline(_applicationConfigurationMock.Object, _objectFactoryMock.Object); var deploymentInfo = DeploymentInfoGenerator.GetNtServiceDeploymentInfo(); Assert.Throws <ArgumentNullException>(() => pipeline.StartDeployment(null, new DummyDeploymentTask(projectInfoRepositoryFake.Object, environmentInfoRepositoryFake.Object), new DeploymentContext("requester"), false)); Assert.Throws <ArgumentNullException>(() => pipeline.StartDeployment(deploymentInfo, null, new DeploymentContext("requester"), false)); Assert.Throws <ArgumentNullException>(() => pipeline.StartDeployment(deploymentInfo, new DummyDeploymentTask(projectInfoRepositoryFake.Object, environmentInfoRepositoryFake.Object), null, false)); }