public void CreateUserStoryAndThenDeleteItSucceeds() { //Create a story var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.UserStories) }; var story = new UserStory { Name = $"Sample Create From Code Story - {DateTime.Now}", Project = new Project { Id = 194 } }; var data = client.CreateData <UserStory>(story); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); Assert.NotNull(data.Data.Project); Assert.NotNull(data.Data.Project.Id); var createdId = data.Data.Id; Assert.NotEqual(0, createdId); Assert.NotNull(createdId); var result = client.DeleteData <UserStory>((int)createdId); Assert.NotNull(result); Assert.NotNull(result.Data.Id); Assert.Equal(createdId, result.Data.Id); Assert.Null(result.Data.Project); }
public void CreateEpicAndThenDeleteItSucceeds() { //Create an epic var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Epics) }; var epic = new Epic { Name = $"Sample Epic From Code - {DateTime.Now}", Project = new Project { Id = 194 } }; var data = client.CreateData <Epic>(epic); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); Assert.NotNull(data.Data.Project); Assert.NotNull(data.Data.Project.Id); var createdId = data.Data.Id; Assert.NotEqual(0, createdId); Assert.NotNull(createdId); var result = client.DeleteData <Epic>((int)createdId); Assert.NotNull(result); Assert.NotNull(result.Data.Id); Assert.Equal(createdId, result.Data.Id); Assert.Null(result.Data.Project); }
public void UpdateEpicWithMinimumDataSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Epics) }; var originalName = $"Sample Epic From Code - {DateTime.Now}"; var epic = new Epic { Name = originalName, Project = new Project { Id = 194 } }; var data = client.CreateData <Epic>(epic); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); var newName = $"Sample Modified Epic From Code - {DateTime.Now}"; var newEpic = new Epic { Id = data.Data.Id, Project = data.Data.Project, Name = newName }; var newData = client.UpdateData <Epic>(newEpic); // Verify name changed Assert.NotEqual(newData.Data.Name, originalName); Assert.Equal(newData.Data.Name, newName); // Verify ID did NOT change Assert.Equal(data.Data.Id, newData.Data.Id); }
public void UpdateFeatureWithNameAndProjectIdSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Features) }; var name = $"Sample Feature From Code - {DateTime.Now}"; var feature = new Feature { Name = name, Project = new Project { Id = 194 } }; var data = client.CreateData <Feature>(feature); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); var newName = $"Sample Modified Feature From Code - {DateTime.Now}"; var newFeature = new Feature { Id = data.Data.Id, Name = newName, Project = data.Data.Project }; var newData = client.UpdateData <Feature>(newFeature); // Verify name changed Assert.NotEqual(newData.Data.Name, name); Assert.Equal(newData.Data.Name, newName); // Verify ID did NOT change Assert.Equal(data.Data.Id, newData.Data.Id); }
public void CreateTimeAndThenDeleteItSucceeds() { //Create a Time var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Times) }; var time = new Time(); var data = client.CreateData <Time>(time); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); var createdId = data.Data.Id; Assert.NotEqual(0, createdId); Assert.NotNull(createdId); var result = client.DeleteData <Time>((int)createdId); Assert.NotNull(result); Assert.NotNull(result.Data.Id); Assert.Equal(createdId, result.Data.Id); }
public void CreateEpicThrowsError() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Epics) }; var epic = new Epic(); var data = client.CreateData <Epic>(epic); Assert.NotNull(data); Assert.True(data.HttpResponse.IsError); }
public void CreateAssignableThrowsError() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Assignables) }; var assignable = new Assignable { //EntityState = new EntityState { Name = "Some Entity state"} }; var data = client.CreateData <Assignable>(assignable); }
public void CreateTaskThrowsError() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Tasks) }; var task = new Task(); var data = client.CreateData <Task>(task); Assert.NotNull(data); Assert.True(data.HttpResponse.IsError); }
public void CreateFeatureWithoutNameThrowsError() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Features) }; var feature = new Feature(); var data = client.CreateData <Feature>(feature); Assert.NotNull(data); Assert.True(data.HttpResponse.IsError); }
public void CreateTimeWithMinimumFieldsSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Times) }; var time = new Time(); var data = client.CreateData <Time>(time); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); }
public void AppContextThrowsError() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.AppContexts) }; var appContext = new AppContext { }; var data = client.CreateData <AppContext>(appContext); Assert.False(data.HttpResponse.IsError); }
public void CreateProjectWithoutNameThrowsError() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Projects) }; var project = new Project(); var data = client.CreateData <Project>(project); Assert.NotNull(data); Assert.True(data.HttpResponse.IsError); }
public void CreateBugThrowsError() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Bugs) }; var bug = new Bug { }; var data = client.CreateData <Bug>(bug); Assert.NotNull(data); Assert.True(data.HttpResponse.IsError); }
public void CreateTaskWithNameThrowsError() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Tasks) }; var task = new Task { Name = $"Sample Task From Code - {DateTime.Now}" }; var data = client.CreateData <Task>(task); Assert.NotNull(data); Assert.True(data.HttpResponse.IsError); }
public void CreateFeatureWithNameButNoProjectIdFails() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Features) }; var feature = new Feature { Name = $"Sample Feature From Code - {DateTime.Now}" }; var data = client.CreateData <Feature>(feature); Assert.NotNull(data); Assert.True(data.HttpResponse.IsError); }
public void CreateProjectWithMinimumFieldsSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Projects) }; var project = new Project { Name = $"Sample Project From Code - {DateTime.Now}" }; var data = client.CreateData <Project>(project); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); }
public void CreateEpicithoutProjectIdFails() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Epics) }; var epic = new Epic { Name = $"Sample Epic From Code - {DateTime.Now}", }; var data = client.CreateData <Epic>(epic); Assert.NotNull(data); Assert.True(data.HttpResponse.IsError); }
public void CreateBugWithMinimumDataSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Bugs) }; var bug = new Bug { Name = $"Sample Bug From Code - {DateTime.Now}", Project = new Project { Id = 194 }, }; var data = client.CreateData <Bug>(bug); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); }
public void CreateFeatureWithNameAndProjectIdSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Features) }; var feature = new Feature { Name = $"Sample Feature From Code - {DateTime.Now}", Project = new Project { Id = 194 } }; var data = client.CreateData <Feature>(feature); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); }
public void CreateEpicWithMinimumDataSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Epics) }; var epic = new Epic { Name = $"Sample Epic From Code - {DateTime.Now}", Project = new Project { Id = 194 } }; var data = client.CreateData <Epic>(epic); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); }
public void UpdateTimeWithDescriptionFieldsSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Times) }; var description = $"Sample Time Description - {DateTime.Now}"; //Create a time entry var time = new Time { Description = description }; var data = client.CreateData <Time>(time); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); //get the ID var id = data.Data.Id; Assert.Equal(data.Data.Description, description); // Update the time entry var newDescription = $"Sample Modified Time Description - {DateTime.Now}"; var timeModified = new Time { Id = id, Description = newDescription }; var newData = client.UpdateData <Time>(timeModified); Assert.NotNull(newData); Assert.False(newData.HttpResponse.IsError); Assert.NotEqual(newData.Data.Description, description); Assert.False(newData.HttpResponse.IsError); // Verify description changed Assert.Equal(newData.Data.Description, newDescription); // Verify ID did NOT change Assert.Equal(data.Data.Id, newData.Data.Id); }
public void CreateTaskWithMinimumDataSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Tasks) }; var task = new Task { Name = $"Sample Task From Code - {DateTime.Now}", Project = new Project { Id = 194 }, UserStory = new UserStory { Id = 204 } }; var data = client.CreateData <Task>(task); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); }
public void CreateTaskAndThenDeleteItSucceeds() { //Create a task var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Tasks) }; var task = new Task { Name = $"Sample Task From Code - {DateTime.Now}", Project = new Project { Id = 194 }, UserStory = new UserStory { Id = 204 } }; var data = client.CreateData <Task>(task); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); var createdId = data.Data.Id; Assert.NotEqual(0, createdId); Assert.NotNull(createdId); Assert.NotNull(data.Data.Project); Assert.NotNull(data.Data.UserStory); var result = client.DeleteData <Task>((int)createdId); Assert.NotNull(result); Assert.NotNull(result.Data.Id); Assert.Equal(createdId, result.Data.Id); Assert.Null(result.Data.Project); Assert.Null(result.Data.UserStory); }
public void UpdateTaskWithMinimumDataSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Tasks) }; var originalName = $"Sample Task From Code - {DateTime.Now}"; var task = new Task { Name = originalName, Project = new Project { Id = 194 }, UserStory = new UserStory { Id = 204 } }; var data = client.CreateData <Task>(task); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); var newName = $"Sample Modified Task From Code - {DateTime.Now}"; var newTask = new Task { Id = data.Data.Id, Project = data.Data.Project, UserStory = data.Data.UserStory, Name = newName }; var newData = client.UpdateData <Task>(newTask); // Verify name changed Assert.NotEqual(newData.Data.Name, originalName); Assert.Equal(newData.Data.Name, newName); // Verify ID did NOT change Assert.Equal(data.Data.Id, newData.Data.Id); }
public void UpdateUserStoryWithNameAndProjectWithIdMinimumFieldsSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.UserStories) }; var originalName = $"Sample Create From Code Story - {DateTime.Now}"; var story = new UserStory { Name = originalName, Project = new Project { Id = 194 } }; var data = client.CreateData <UserStory>(story); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); var newName = $"Sample Modified User Story From Code - {DateTime.Now}"; var newStory = new UserStory { Id = data.Data.Id, Name = newName, Project = data.Data.Project }; var newData = client.UpdateData <UserStory>(newStory); Assert.NotNull(newData); Assert.False(newData.HttpResponse.IsError); // Verify name changed Assert.NotEqual(newData.Data.Name, originalName); Assert.Equal(newData.Data.Name, newName); // Verify ID did NOT change Assert.Equal(data.Data.Id, newData.Data.Id); }
public void UpdateProjectWithMinimumFieldsSucceeds() { var client = new TargetProcessClient { ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Projects) }; var originalName = $"Sample Project From Code - {DateTime.Now}"; var project = new Project { Name = originalName }; var data = client.CreateData <Project>(project); Assert.NotNull(data); Assert.False(data.HttpResponse.IsError); var newName = $"Sample Modified Project Name From Code - {DateTime.Now}"; var projectModified = new Project { Id = data.Data.Id, Name = newName }; var newData = client.UpdateData <Project>(projectModified); Assert.NotNull(newData); Assert.False(newData.HttpResponse.IsError); Assert.False(newData.HttpResponse.IsError); // Verify name changed Assert.NotEqual(newData.Data.Name, originalName); Assert.Equal(newData.Data.Name, newName); // Verify ID did NOT change Assert.Equal(data.Data.Id, newData.Data.Id); }