Пример #1
0
        protected void Setup(IQueryable <T> entries = null)
        {
            if (entries == null)
            {
                entries = GenerateFixtures();
            }

            ModelEntries = entries;

            _mockDbSet = GenerateDBSetHelper <T> .GenerateDbSet(entries);

            _context    = new Mock <EFDbContext>();
            _iAPIMethod = new Mock <T1>();
            _config     = new Mock <IConfig>();
        }
Пример #2
0
        public void Initialize()
        {
            IQueryable <Models.VSTS.WorkItem> workItems = new List <Models.VSTS.WorkItem>()
            {
                new Models.VSTS.WorkItem()
                {
                    Id = 12345, Description = "Description #1"
                },
                new Models.VSTS.WorkItem()
                {
                    Id = 54321, Description = "Description #2"
                }
            }.AsQueryable();

            _mockDbSet = GenerateDBSetHelper <Models.VSTS.WorkItem> .GenerateDbSet(workItems);

            _context = new Mock <EFDbContext>();

            _context.Setup(x => x.VSTSWorkItems).Returns(_mockDbSet.Object);
            _baseMock = new BaseMock(_context.Object);
        }