public void CreateNewProjectInactiveUser() { var pm = new ProjectManager { DocumentStore = _embeddedDocStore }; var user = new UserAccount { Username = "******" }; const string projectName = "project"; var exceptionMessage = string.Format("Cannot create new project '{0}' - {1} is an inactive user.", projectName, user.Username); Assert.That(() => pm.CreateProject(projectName, user), Throws.ArgumentException.With.Message.EqualTo(exceptionMessage)); }
public void CreateNewProjectUniqueName() { var pm = new ProjectManager { DocumentStore = _embeddedDocStore }; const string projectName = "newProject"; var user = new UserAccount(); var createdProject = pm.CreateProject(projectName, user); Assert.That(createdProject.Owner, Is.EqualTo(user.Username)); Assert.That(createdProject.Name, Is.EqualTo(projectName)); AssertProjectIsCreated(projectName, user.Username); }
public void CreateNewProjectDuplicateName() { var pm = new ProjectManager { DocumentStore = _embeddedDocStore }; const string projectName = "existing"; var user = new UserAccount(); var exceptionMessage = string.Format("Cannot create new project '{0}' - this project name is already in use.", projectName); Assert.That(() => pm.CreateProject(projectName, user), Throws.ArgumentException.With.Message.EqualTo(exceptionMessage)); }