public async Task Test_Put()
        {
            using (var client = new TestClientProvider().Client)
            {
                var response = await client.PutAsync("/api/person", new StringContent(
                                                         JsonConvert.SerializeObject(
                                                             new YangdoDTO.Person()
                {
                    PersonId = 1003, FirstName = "KilDong2", LastName = "Hong2", Email = "*****@*****.**", Phone = "01052345678", DOB = Convert.ToDateTime("15/02/1981")
                }
                                                             )
                                                         , Encoding.UTF8, "application/json"));

                response.EnsureSuccessStatusCode();

                response.StatusCode.Should().Be(HttpStatusCode.Created);
            }
        }
Exemple #2
0
        public async Task Test_Put()
        {
            using (var client = new TestClientProvider().Client)
            {
                var response = await client.PutAsync("/api/timesheet", new StringContent(
                                                         JsonConvert.SerializeObject(
                                                             new YangdoDTO.TimeSheet()
                {
                    TimeSheetId = 2002, PersonId = 1004, TaskId = 1003, TimeFrom = Convert.ToDateTime("2020-02-26 10:30:00"), TimeTo = Convert.ToDateTime("2020-02-26 12:30:00")
                }
                                                             )
                                                         , Encoding.UTF8, "application/json"));

                response.EnsureSuccessStatusCode();

                response.StatusCode.Should().Be(HttpStatusCode.Created);
            }
        }
        public async Task Test_Put()
        {
            using (var client = new TestClientProvider().Client)
            {
                var response = await client.PutAsync("/api/task", new StringContent(
                                                         JsonConvert.SerializeObject(
                                                             new YangdoDTO.Task()
                {
                    TaskId = 1002, TaskName = "Design DB Schema2", TaskDesc = "Design DB Schema2 - desc"
                }
                                                             )
                                                         , Encoding.UTF8, "application/json"));

                response.EnsureSuccessStatusCode();

                response.StatusCode.Should().Be(HttpStatusCode.Created);
            }
        }