public void ConfigurationRequirement_ToString_Collection_NoMaximumCount_Succeeds()
        {
            ConfigurationRequirement requirement =
                TestUtil.CreateConfigurationRequirement(collectionInfo: new CollectionInfo(3));

            JsonCompare.Compare(requirement, requirement.ToString());
        }
        public void ConfigurationRequirement_ToString_Succeeds()
        {
            ConfigurationRequirement requirement =
                TestUtil.CreateConfigurationRequirement();

            JsonCompare.Compare(requirement, requirement.ToString());
        }
Esempio n. 3
0
        public static void Compare(
            ConfigurationRequirement expected,
            string actual)
        {
            JObject jObj = JObject.Parse(actual);

            Assert.AreEqual(7, jObj.Count);
            Assert.AreEqual(expected.Name, jObj["Name"]);
            Assert.AreEqual(expected.Description, jObj["Description"]);
            Assert.AreEqual(expected.IsOptional, jObj["IsOptional"]);
            Assert.AreEqual(expected.OfType.Type.FullName, jObj["OfType"]);
            JsonCompare.Compare(expected.CollectionInfo, jObj["CollectionInfo"]);
            JsonCompare.Compare(expected.DependsOn, jObj.Value <JArray>("DependsOn"));
            JsonCompare.Compare(expected.ExclusiveWith, jObj.Value <JArray>("ExclusiveWith"));
        }