static void PrintProject( Project project ) { Console.WriteLine( "\nProject\n" ); Console.WriteLine( "\tId: " + project.Id.ToString() ); Console.WriteLine( "\tName: " + project.Name ); Console.WriteLine( "\tDescription: " + project.Description ); }
public void IsNotValid_IfNoProjectStatusAssigned() { var project = new Project( _sessionFactory.Object ) { Id = Guid.NewGuid(), Name = "New Project", Description = "This is just for testing" }; Assert.IsFalse( project.IsValidFor( TransactionType.All ) ); var messages = project.GetErrorMessages(); Assert.AreEqual( 1, messages.Count ); Assert.AreEqual( "The Status field is required.", messages["Status"] ); }
public void IsNotValid_IfDifferentProjectWithSameNameExists() { var project = new Project( _sessionFactory.Object ) { Id = Guid.NewGuid(), Name = Projects.ModelData[0].Name, Description = "This is just for testing", Status = ProjectStatuses.ModelData[0] }; Assert.IsFalse( project.IsValidFor( TransactionType.All ) ); var messages = project.GetErrorMessages(); Assert.AreEqual( 1, messages.Count ); Assert.AreEqual( String.Format( ErrorMessages.NameIsNotUnique, "Project", project.Name ), messages["Name"] ); }
private static void InitializeProjects() { homeScrum = Projects.ModelData.First( x => x.Name == "Home Scrum" ); sandwiches = Projects.ModelData.First( x => x.Name == "Sandwiches" ); preps = Projects.ModelData.First( x => x.Name == "PRepS" ); mathWar = Projects.ModelData.First( x => x.Name == "MathWar" ); }
private static WorkItem CreateWorkItem( string name, string description, WorkItemType wit, WorkItemStatus status, Project project, int points = 1, int pointsRemaining = 0 ) { var workItem = new WorkItem() { Name = name, Description = description, WorkItemType = wit, Status = status, CreatedByUser = GetRandomUser(), LastModifiedUserRid = GetRandomUser().Id, Project = project, Points = points, PointsRemaining = pointsRemaining }; workItem.Tasks = new List<WorkItem>(); workItem.PointsHistory = new List<WorkItemDailySnapshot>(); _workItems.Add( workItem ); return workItem; }
public void InitializeTest() { _translator = new ProjectPropertyNameTranslator(); _sourceObject = new Project(); }
private ProjectEditorViewModel CreateProjectEditorViewModel( Project project ) { return new ProjectEditorViewModel() { Id = project.Id, Name = project.Name, Description = project.Description, LastModifiedUserId = project.LastModifiedUserRid, StatusId = project.Status.Id, StatusName = project.Status.Name }; }