예제 #1
0
파일: UnitTest1.cs 프로젝트: loysset/retos
        public void Not_Listed_Property_Is_Not_Invoked()
        {
            var dumper = new ObjectDumper<CrashedUfo>();
            var crashed = new CrashedUfo()
            {
                Name = "Conqueror III",
                Speed = 10,
                Origin = new Planet()
                {
                    Name = "Alpha Centauri 3",
                    DaysPerYear = 452
                }
            };

            var desc = dumper.Dump(crashed);
            var twoPropertiesList = desc.Take(2).ToList();
            // No exception at this point because ZLastProperty is *never* invoked
            Assert.AreEqual(2, twoPropertiesList.Count);
        }
예제 #2
0
        public void Not_Listed_Property_Is_Not_Invoked()
        {
            var dumper  = new ObjectDumper <CrashedUfo>();
            var crashed = new CrashedUfo()
            {
                Name   = "Conqueror III",
                Speed  = 10,
                Origin = new Planet()
                {
                    Name        = "Alpha Centauri 3",
                    DaysPerYear = 452
                }
            };

            var desc = dumper.Dump(crashed);
            var twoPropertiesList = desc.Take(2).ToList();

            // No exception at this point because ZLastProperty is *never* invoked
            Assert.AreEqual(2, twoPropertiesList.Count);
        }