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); }
/// <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); }
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); }
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 }; }
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; }
public EmployeeService(CompanyDataContext context, IEmployeeRepository employeeRepo) { _context = context; _employeeRepo = employeeRepo; }
public DownloadMgr() { ctx = new CompanyDataContext(); }
public EmployeesController(CompanyDataContext context, IEmployeeService employeeService) { _employeeService = employeeService; }
public ProjectsController(CompanyDataContext context, IProjectService projectService) { _context = context; _projectService = projectService; }
public ProductMgr() { ctx = new CompanyDataContext(); }
public EmployeeRepository(CompanyDataContext context) : base(context) { }
public BuildingsController(CompanyDataContext context, IBuildingService buildingService) { _context = context; _buildingService = buildingService; }
public DepartmentsController(CompanyDataContext context, IDepartmentService departmentService) { _context = context; _departmentService = departmentService; }
public ArticleMgr() { ctx = new CompanyDataContext(); }