public void Get_List_ReturnsList()
        {
            // Add 20 mocks to a list
            List<Mock<IObjectGenerator<SimpleUser>>> mocks = new List<Mock<IObjectGenerator<SimpleUser>>>();
            for (int x = 0; x < 20; x++)
            {
                mocks.Add(new Mock<IObjectGenerator<SimpleUser>>());
            }

            // Set up
            CollectionContext<SimpleUser, List<SimpleUser>> context =
                new CollectionContext<SimpleUser, List<SimpleUser>>(
                        mocks.Select(x => (IObjectGenerator<SimpleUser>)x.Object));

            List<SimpleUser> users= context.Get();
            Assert.AreEqual(20, users.Count);
        }
        public void Get_Array_ReturnsArray()
        {
            // Add 20 mocks to a list
            List<Mock<IObjectGenerator<SimpleUser>>> mocks = new List<Mock<IObjectGenerator<SimpleUser>>>();
            for (int x = 0; x < 20; x++)
            {
                mocks.Add(new Mock<IObjectGenerator<SimpleUser>>());
            }

            // Set up
            CollectionContext<SimpleUser, SimpleUser[]> context =
                new CollectionContext<SimpleUser, SimpleUser[]>(
                        mocks.Select(x => (IObjectGenerator<SimpleUser>)x.Object));

            SimpleUser[] users = context.Get();
            Assert.AreEqual(20, users.Length);
        }
Beispiel #3
0
        public void Get_Array_ReturnsArray()
        {
            // Add 20 mocks to a list
            List <Mock <IObjectGenerator <SimpleUser> > > mocks = new List <Mock <IObjectGenerator <SimpleUser> > >();

            for (int x = 0; x < 20; x++)
            {
                mocks.Add(new Mock <IObjectGenerator <SimpleUser> >());
            }

            // Set up
            CollectionContext <SimpleUser, SimpleUser[]> context =
                new CollectionContext <SimpleUser, SimpleUser[]>(
                    mocks.Select(x => (IObjectGenerator <SimpleUser>)x.Object));

            SimpleUser[] users = context.Get();
            Assert.AreEqual(20, users.Length);
        }
Beispiel #4
0
        public void Get_List_ReturnsList()
        {
            // Add 20 mocks to a list
            List <Mock <IObjectGenerator <SimpleUser> > > mocks = new List <Mock <IObjectGenerator <SimpleUser> > >();

            for (int x = 0; x < 20; x++)
            {
                mocks.Add(new Mock <IObjectGenerator <SimpleUser> >());
            }

            // Set up
            CollectionContext <SimpleUser, List <SimpleUser> > context =
                new CollectionContext <SimpleUser, List <SimpleUser> >(
                    mocks.Select(x => (IObjectGenerator <SimpleUser>)x.Object));

            List <SimpleUser> users = context.Get();

            Assert.AreEqual(20, users.Count);
        }