public void MissingProjectName_ThrowsError() { var repository = new Mock<IProjectRepository>(); string projectId = Guid.NewGuid().ToString(); string projectName = string.Empty; IProjectManager sut = new ProjectManager(repository.Object, new Mock<IDeployTaskFactory>().Object); Assert.Throws<ArgumentNullException>(delegate { sut.UpdateProject(projectId, projectName, true); }); repository.Verify(i => i.UpdateProject(projectId, projectName, true), Times.Never()); }
public void CanUpdateProject() { var repository = new Mock<IProjectRepository>(); string projectId = Guid.NewGuid().ToString(); string projectName = Guid.NewGuid().ToString(); IProjectManager sut = new ProjectManager(repository.Object, new Mock<IDeployTaskFactory>().Object); sut.UpdateProject(projectId, projectName, true); repository.Verify(i=>i.UpdateProject(projectId, projectName, true), Times.Once()); }