Beispiel #1
0
        public async Task BasicPatchTests([CombinatorialValues("movies", "movies_pagesize")] string table)
        {
            var id       = GetRandomId();
            var expected = MovieServer.GetMovieById(id) !;

            expected.Title  = "Test Movie Title";
            expected.Rating = "PG-13";
            var patchDoc = new PatchOperation[]
            {
                new PatchOperation("replace", "title", "Test Movie Title"),
                new PatchOperation("replace", "rating", "PG-13")
            };

            var response = await MovieServer.SendPatch($"tables/{table}/{id}", patchDoc);

            await AssertResponseWithLoggingAsync(HttpStatusCode.OK, response);

            var result = response.DeserializeContent <ClientMovie>();
            var stored = MovieServer.GetMovieById(id);

            AssertEx.SystemPropertiesSet(stored, StartTime);
            AssertEx.SystemPropertiesChanged(expected, stored);
            AssertEx.SystemPropertiesMatch(stored, result);
            Assert.Equal <IMovie>(expected, result !);
            AssertEx.ResponseHasConditionalHeaders(stored, response);
        }