Ejemplo n.º 1
0
        public static void ClassInitialize()
        {
            var orchestrate = new Orchestrate(TestHelper.ApiKey);
            var item = new TestData { Id = 1, Value = "Inital Test Item" };

            orchestrate.Put(CollectionName, "1", item);

            item.Value = "Updated Value";
            orchestrate.Patch(CollectionName, "1", item);
        }
Ejemplo n.º 2
0
        public void PatchAddModel()
        {
            var item = new TestData {
                Id = 3, Value = "John"
            };
            var putResult = _orchestrate.Put(CollectionName, "3", item);

            Assert.IsTrue(putResult.Path.Ref.Length > 0);

            var patchItem = new PatchModel {
                op = "add", value = "Newly added value", path = "Value"
            };
            var patchResult = _orchestrate.Patch(CollectionName, "3", patchItem);
            var testValue   = JsonConvert.DeserializeObject <TestData>(_orchestrate.Get(CollectionName, "3").Value.ToString());

            Assert.IsTrue(testValue.Value.Equals("TestJSONPATCH"));
        }