Exemple #1
0
        public void UpdateOperation_AddsInts_DeserializesCorrectly()
        {
            // Setup
            var updateOp = new UpdateOperation();

            updateOp.UpdateFieldWithNumber("field1", "19");

            // System under test
            string resultJson = updateOp.ToJson();

            // Verify
            string expectedJson = "{\"field1\":19}";

            Assert.AreEqual(expectedJson, resultJson);
        }
Exemple #2
0
        public void UpdateOperation_UpdateFieldWithObject_Double_SameAsUpdateFieldWithNumber()
        {
            double value = 3.14;

            var updateOp1 = new UpdateOperation();

            updateOp1.UpdateFieldWithNumber("field", value);
            string json1 = updateOp1.ToJson();

            var updateOp2 = new UpdateOperation();

            updateOp2.UpdateFieldWithObject("field", value);
            string json2 = updateOp2.ToJson();

            Assert.AreEqual(json1, json2);
        }