Ejemplo n.º 1
0
        public async Task Update_WithNoProjectId_ThrowsException(ProjectSyncanoClient client)
        {
            try
            {
                //when
                await client.Update(null);

                throw new Exception("Update should throw an exception");
            }
            catch (Exception e)
            {
                //then
                e.ShouldBeType <ArgumentNullException>();
            }
        }
Ejemplo n.º 2
0
        public async Task Update_WithInvalidProjectId_ThrowsException(ProjectSyncanoClient client)
        {
            try
            {
                //when
                await client.Update("abc");

                throw new Exception("Update should throw an exception");
            }
            catch (Exception e)
            {
                //then
                e.ShouldBeType <SyncanoException>();
            }
        }
Ejemplo n.º 3
0
        public async Task Update_WithNoNewValues(ProjectSyncanoClient client)
        {
            //given
            string projectName = "UpdateProject test " + DateTime.Now.ToLongTimeString() + " " +
                                 DateTime.Now.ToShortDateString();

            var project = await client.New(projectName);

            //when
            project = await client.Update(project.Id);

            //then
            project.ShouldNotBeNull();
            project.Name.ShouldEqual(projectName);
            project.Description.ShouldBeNull();

            //cleanup
            await client.Delete(project.Id);
        }
Ejemplo n.º 4
0
        public async Task Update_CreatesProjectObjectWithNewValues(ProjectSyncanoClient client)
        {
            //given
            var projectName = "UpdateProject test " + DateTime.Now.ToLongTimeString() + " " +
                              DateTime.Now.ToShortDateString();
            var projectNewName = "UpdateProject test new name" + DateTime.Now.ToLongTimeString() + " " +
                                 DateTime.Now.ToShortDateString();
            const string projectOldDescription = "qwerty";
            const string projectNewDescription = "abc";
            var          project = await client.New(projectName, projectOldDescription);

            //when
            project = await client.Update(project.Id, projectNewName, projectNewDescription);

            //then
            project.ShouldNotBeNull();
            project.Name.ShouldEqual(projectNewName);
            project.Description.ShouldEqual(projectNewDescription);

            //cleanup
            await client.Delete(project.Id);
        }