Пример #1
0
        public void ShowFieldsIfNoPropertyAvailalbe()
        {
            var showInfo = MemberProvider.Create(new FieldsWithUnderLines());

            var value = showInfo.Value;
            var names = value.GetNames();

            Assert.IsTrue(names.Contains("_Field"));
            Assert.IsTrue(names.Contains("_OtherField"));
        }
Пример #2
0
        public void MixBag()
        {
            var showInfo = MemberProvider.Create(new MixedBag());

            var value = showInfo.Value;
            var names = value.GetNames();

            Assert.IsTrue(names.Contains("_Field"));
            Assert.IsTrue(names.Contains("AutoProperty"));
            Assert.IsTrue(names.Contains("AProperty"));
        }
Пример #3
0
        public void CanDealWithAnonymousTypes()
        {
            var showInfo = MemberProvider.Create(new { A = "Fun", B = "More Fun" });

            Assert.IsFalse(showInfo.HasValue);
        }
Пример #4
0
        public void EnumerablesAreNotVisualized()
        {
            var showInfo = MemberProvider.Create(new [] { new FieldsAndProperties() });

            Assert.IsFalse(showInfo.HasValue);
        }
Пример #5
0
        public void OnlyApplyToGeneratedTypes()
        {
            var showInfo = MemberProvider.Create(new ArgumentException("test"));

            Assert.IsFalse(showInfo.HasValue);
        }
Пример #6
0
        public void ExceptionIsNotVisualized()
        {
            var showInfo = MemberProvider.Create(new ArgumentException("test"));

            Assert.IsFalse(showInfo.HasValue);
        }
Пример #7
0
        public void OnlyShowProperties()
        {
            var showInfo = MemberProvider.Create(new FieldsAndProperties());

            AssertInfo(showInfo.Value);
        }