Пример #1
0
        public void GetObjectProperties_ArgumentNullException()
        {
            const object rawObject = null;

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

            CollectionAssert.AreEquivalent(expectedDict, ObjectUtil.GetObjectProperties(new Foo()));
        }
Пример #3
0
 public override IReadOnlyDictionary <string, string> RawProperties() => ObjectUtil.GetObjectProperties(SyntaxTrivia);