public void AddStreamToActiveProjectUserNotInProjectThrowsException() { var projectManager = new ProjectManager { Session = _embeddedDocStore.OpenSession() }; var newProjectStream = new ProjectStream("Stream1", "Create a new stream that takes over the whole project."); var exceptionMessage = string.Format("User {0} is currently not active in Project {1}.", activeUserNotInProject.Username, activeProject.Name); Assert.That(() => projectManager.AddProjectStream(activeProject.Name, newProjectStream, activeUserNotInProject.Username), Throws.ArgumentException.With.Message.EqualTo(exceptionMessage)); }
public void AddStreamToCompleteProjectThrowsException() { var projectManager = new ProjectManager { Session = _embeddedDocStore.OpenSession() }; var newProjectStream = new ProjectStream("Stream1", "Create a new stream that takes over the whole project."); const string exceptionMessage = "Cannot add stream to project with status of Complete."; Assert.That(() => projectManager.AddProjectStream(completedProject.Name, newProjectStream, activeUser.Username), Throws.ArgumentException.With.Message.EqualTo(exceptionMessage)); }
public void AddStreamToActiveProjectSuccess() { var projectManager = new ProjectManager { Session = _embeddedDocStore.OpenSession() }; var newProjectStream = new ProjectStream("Stream1", "Create a new stream that takes over the whole project."); projectManager.AddProjectStream(activeProject.Name, newProjectStream, activeUser.Username); var session = _embeddedDocStore.OpenSession(); var project = session.Query<Project>().Where(p => p.Name == activeProject.Name).First(); Assert.That(project.ProjectStreams.Count, Is.EqualTo(1)); Assert.That(project.ProjectStreams[0].CreatedBy, Is.EqualTo(activeUser.Username)); }