public void Serialize_DoesNotSerializeSinceNotConfigured(string propName)
        {
            TestA ta = new TestA();
            ContractConfiguration <TestA> cc = new ContractConfiguration <TestA>();

            var json = JsonConvert.SerializeObject(ta, GetSettings(cc));

            JsonStringValidator jsAssert = new JsonStringValidator(json);

            Assert.IsFalse(jsAssert.HasProperty(propName));
        }
        public void Serialize_IgnorePrivateField()
        {
            TestA ta = new TestA();

            ta.SetPrivateField(1);
            ContractConfiguration <TestA> cc = new ContractConfiguration <TestA>();

            cc.Field("privateField").Ignore();

            var staticJson = JsonConvert.SerializeObject(ta);
            var json       = JsonConvert.SerializeObject(ta, GetSettings(cc));

            JsonStringValidator jsAssertStatic = new JsonStringValidator(staticJson);

            Assert.IsTrue(jsAssertStatic.HasProperty("privateField"));

            JsonStringValidator jsAssert = new JsonStringValidator(json);

            Assert.IsFalse(jsAssert.HasProperty("privateField"));
        }
        public void Serialize_IgnoreProperty()
        {
            TestA ta = new TestA()
            {
                IdA = 1
            };
            ContractConfiguration <TestA> cc = new ContractConfiguration <TestA>();

            cc.Property(ta => ta.IdA).Ignore();

            var staticJson = JsonConvert.SerializeObject(ta);
            var json       = JsonConvert.SerializeObject(ta, GetSettings(cc));

            JsonStringValidator jsAssertStatic = new JsonStringValidator(staticJson);

            Assert.IsTrue(jsAssertStatic.HasProperty("idA"));

            JsonStringValidator jsAssert = new JsonStringValidator(json);

            Assert.IsFalse(jsAssert.HasProperty("idA"));
        }