Пример #1
0
        public void Create_from_property_should_yield_items_from_lists(string property)
        {
            var prop = Property(property);
            var ctxt = SelfTestUtility.NewTestContext(new FakeTheory(fakeTestMethod), new FakeRunner());

            Assert.Equal(2, TestData.Create(ctxt, MemberAccessors.Property(prop)).Count());
        }
Пример #2
0
        public void Create_from_property_should_yield_singleton_return_type(string property)
        {
            var prop   = Property(property);
            var ctxt   = SelfTestUtility.NewTestContext(new FakeTheory(fakeTestMethod), new FakeRunner());
            var actual = TestData.Create(ctxt, MemberAccessors.Property(prop));

            Assert.Equal(1, actual.Count());
            Assert.Equal("420", actual.First()[0]);
        }
        private TestData[] GetData(Func <FixtureDataAttribute> func)
        {
            var fake = new ReflectedTheory(
                GetType().GetMethod("FakeTheory", BindingFlags.NonPublic | BindingFlags.Instance
                                    ));
            var context = SelfTestUtility.NewTestContext(fake, new FakeRunner());
            var fd      = func();

            return(((ITestDataProvider)fd).GetData(context).ToArray());
        }