Пример #1
0
        public BookServiceTest()
        {
            TinyIoCContainer tiny = new TinyIoCContainer();

            stubIDbContextBook = new StubIDbContext <Book>();
            tiny.Register <IDbContext <Book>, StubIDbContext <Book> >(stubIDbContextBook);
            _bookService = tiny.Resolve <BookService>();
        }
        public UserServiceTest()
        {
            TinyIoCContainer tiny = new TinyIoCContainer();

            stubIDbContextUser = new StubIDbContext <User>();
            tiny.Register <IDbContext <User>, StubIDbContext <User> >(stubIDbContextUser);
            _userService = tiny.Resolve <UserService>();
        }
        private static OrderBl GetSystemUnderTest()
        {
            IDbContext dbContext = new StubIDbContext()
            {
                NonStaticGetEmployees = () => new List<Employee>
                {
                    new Employee {Age = 23, Name = "TEST 3"},
                    new Employee {Age = 26, Name = "TEST 4"}
                }
            };

            var orderBl = new OrderBl(dbContext);
            return orderBl;
        }