Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
 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);
 }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #13
0
        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);
        }
Пример #14
0
        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);
        }
Пример #15
0
        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);
        }
Пример #16
0
        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);
        }
Пример #17
0
        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);
        }
Пример #18
0
        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);
        }
Пример #19
0
        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);
        }
Пример #20
0
        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);
        }
Пример #21
0
        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);
        }
Пример #22
0
        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);
        }
Пример #23
0
        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);
        }
Пример #24
0
        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);
        }
Пример #25
0
        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);
        }
Пример #26
0
        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);
        }