Example #1
0
        public void DepthTest()
        {
            var ctx     = new CompanyDataContext();
            var devDept = ctx.Departments.Where(d => d.Name == "Development").First();

            Assert.AreEqual(3, devDept.Depth());
        }
        public override void Start()
        {
            string connString = string.Format(@"AttachDBFileName='{0}{1}';Server='{2}';Integrated Security=SSPI;Connection Timeout=30",
                                              System.IO.Path.GetDirectoryName(GetType().Assembly.Location),
                                              @"\Sql\Company.mdf",
                                              @".");

            dataContext = new CompanyDataContext(connString);
        }
Example #3
0
        /// <summary>
        /// 显示推荐产品块,目前是自动读取的,没有推荐的
        /// </summary>
        public List <recommend_content> GetRecommendProd()
        {
            ctx = new CompanyDataContext();
            var reLst = new List <recommend_content>();

            reLst = (from s in ctx.recommend_content
                     where s.group_id == 1
                     select s).Take(6).ToList();
            return(reLst);
        }
Example #4
0
        public void TotalCutTest()
        {
            /*NOTE: please recreate database before running this test as soon as "Cut"
             * operation modifies the data and total reduced
             * every time you run the test, so we can't expect the same total */

            var company = new CompanyDataContext();
            var total   = company.Total();

            // http://sourceforge.net/apps/mediawiki/developers/index.php?title=101companies is used for a salary source
            Assert.AreEqual(123456 + 12345 + 1234 + 234567 + 23456 + 2345 + 2344, total);

            company.Cut();
            var afterCut = company.Total();

            Assert.AreEqual(total / 2, afterCut);
        }
Example #5
0
        public GAFTestsBase()
        {
            TaxDataContext     = GetService <TaxDataContext>();
            CompanyDataContext = GetService <CompanyDataContext>();

            GAFRepositoryMock = new Mock <TestGAFRepository>(GetService <TaxDataContext>(),
                                                             GetService <VendorDataContext>(),
                                                             GetService <LocationDataContext>(),
                                                             GetService <ContactDataContext>(),
                                                             GetService <CompanyDataContext>(),
                                                             GetService <CustomerDataContext>(),
                                                             GetService <ARAddressDataContext>(),
                                                             GetService <CountryDataContext>(),
                                                             GetService <SOAddressDataContext>())
            {
                CallBase = true
            };
        }
Example #6
0
 public TestGAFRepository(TaxDataContext taxDataContext,
                          VendorDataContext vendorDataContext,
                          LocationDataContext locationDataContext,
                          ContactDataContext contactDataContext,
                          CompanyDataContext companyDataContext,
                          CustomerDataContext customerDataContext,
                          ARAddressDataContext arAddressDataContext,
                          CountryDataContext countryDataContext,
                          SOAddressDataContext soAddressDataContext)
 {
     _taxDataContext       = taxDataContext;
     _vendorDataContext    = vendorDataContext;
     _locationDataContext  = locationDataContext;
     _contactDataContext   = contactDataContext;
     _companyDataContext   = companyDataContext;
     _customerDataContext  = customerDataContext;
     _arAddressDataContext = arAddressDataContext;
     _countryDataContext   = countryDataContext;
     _soAddressDataContext = soAddressDataContext;
 }
Example #7
0
 public EmployeeService(CompanyDataContext context, IEmployeeRepository employeeRepo)
 {
     _context      = context;
     _employeeRepo = employeeRepo;
 }
Example #8
0
 public DownloadMgr()
 {
     ctx = new CompanyDataContext();
 }
Example #9
0
 public EmployeesController(CompanyDataContext context, IEmployeeService employeeService)
 {
     _employeeService = employeeService;
 }
 public ProjectsController(CompanyDataContext context, IProjectService projectService)
 {
     _context        = context;
     _projectService = projectService;
 }
Example #11
0
 public ProductMgr()
 {
     ctx = new CompanyDataContext();
 }
Example #12
0
 public EmployeeRepository(CompanyDataContext context) : base(context)
 {
 }
Example #13
0
 public BuildingsController(CompanyDataContext context, IBuildingService buildingService)
 {
     _context         = context;
     _buildingService = buildingService;
 }
 public DepartmentsController(CompanyDataContext context, IDepartmentService departmentService)
 {
     _context           = context;
     _departmentService = departmentService;
 }
Example #15
0
 public ArticleMgr()
 {
     ctx = new CompanyDataContext();
 }