public void ProcessAsJson() { var filters = new[] { "Property1", "Property3", "SubObject/Property2" }; var filter = new FilterProcessor(TestData, filters); var json = filter.ProcessAsJson(); var result = JsonConvert.DeserializeObject <TestObject>(json); Assert.AreEqual("1", result.Property1); Assert.IsNull(result.Property2); Assert.AreEqual(3, result.Property3); Assert.IsNull(result.SubObject.Property1); Assert.AreEqual("S2", result.SubObject.Property2); Assert.AreEqual(0, result.SubObject.Property3); Assert.IsNull(result.SubObject.SubObject); }
public void ProcessAsJson() { var filters = new[] { "Property1", "Property3", "SubObject/Property2" }; var filter = new FilterProcessor(TestData, filters); var json = filter.ProcessAsJson(); var result = JsonConvert.DeserializeObject<TestObject>(json); Assert.AreEqual("1", result.Property1); Assert.IsNull(result.Property2); Assert.AreEqual(3, result.Property3); Assert.IsNull(result.SubObject.Property1); Assert.AreEqual("S2", result.SubObject.Property2); Assert.AreEqual(0, result.SubObject.Property3); Assert.IsNull(result.SubObject.SubObject); }