Ejemplo n.º 1
0
        public void GetObjectProperties_ArgumentNullException()
        {
            const object rawObject = null;

            // ReSharper disable once AssignNullToNotNullAttribute
            Assert.Catch <ArgumentNullException>(() => _ = ObjectUtil.GetObjectProperties(rawObject));
        }
Ejemplo n.º 2
0
        public void GetObjectProperties()
        {
            var expectedDict = new Dictionary <string, string> {
                ["PublicProperty"]         = "Apple",
                ["PublicComputedProperty"] = "Backs",
                ["IntegerProperty"]        = "-42",
            };

            CollectionAssert.AreEquivalent(expectedDict, ObjectUtil.GetObjectProperties(new Foo()));
        }
Ejemplo n.º 3
0
 public override IReadOnlyDictionary <string, string> RawProperties() => ObjectUtil.GetObjectProperties(SyntaxTrivia);