public ProjectQuotesViewTest() { driver = new ChromeDriver(@"C:\Q2O\Source\Iterations\Iteration 8\Daikin Project Office\DaikinProjectOffice.Tests\libraries"); projectService = new ProjectServices(); accountService = new AccountServices(); orderService = new OrderServices(); projectVM = new ProjectModel(); projectServiceLight = new ProjectServiceLight(); orderServiceLight = new OrderServiceLight(); addressService = new AddressServices(); user = accountService.GetUserSessionModel("*****@*****.**").Model as UserSessionModel; projectId = this.db.Projects .Where(p => p.ProjectStatusTypeId == ProjectStatusTypeEnum.Open && p.OwnerId == user.UserId).OrderByDescending(p => p.ProjectTypeId) .Select(p => p.ProjectId).FirstOrDefault(); project = this.db.Context.Projects .Where(p => p.OwnerId == user.UserId && p.ProjectStatusTypeId == ProjectStatusTypeEnum.Open ).OrderByDescending(p => p.ProjectTypeId) .FirstOrDefault(); quoteId = this.db.Context.Quotes.Where(q => q.ProjectId == projectId).OrderByDescending(q => q.QuoteId).Select(q => q.QuoteId).FirstOrDefault(); projectVM = projectService.GetProjectModel(user, projectId).Model as ProjectModel; }
public TestProjectAPI() { projectService = new ProjectServices(); serviceResponse = new ServiceResponse(); accountService = new AccountServices(); projectServiceLight = new ProjectServiceLight(); projectApi = new ProjectController(); user = accountService.GetUserSessionModel("*****@*****.**").Model as UserSessionModel; projectId = this.db.Projects.Where(p => p.OwnerId == user.UserId && p.Deleted == false) .OrderByDescending(p => p.ProjectId) .Select(p => p.ProjectId) .FirstOrDefault(); project = this.db.Projects.Where(p => p.ProjectId == projectId && p.OwnerId == user.UserId).FirstOrDefault(); }
public OrderViewTest() { _driver = new ChromeDriver(@"C:\Q2O\Source\Iterations\UnitTesting-PhaseI\Daikin Project Office\DaikinProjectOffice.Tests\libraries"); _projectService = new ProjectServices(); _accountService = new AccountServices(); _orderService = new OrderServices(); //_projectVM = new ProjectViewModel(); _projectVM = new ProjectModel(); _projectServiceLight = new ProjectServiceLight(); _orderServiceLight = new OrderServiceLight(); user = _accountService.GetUserSessionModel("*****@*****.**").Model as UserSessionModel; _projectId = this.db.Context.Projects.Where(p => p.ProjectStatusTypeId == ProjectStatusTypeEnum.Open).OrderByDescending(p => p.ProjectTypeId).Select(p => p.ProjectId).FirstOrDefault(); _quoteId = this.db.Context.Quotes.Where(q => q.ProjectId == _projectId).OrderByDescending(q => q.QuoteId).Select(q => q.QuoteId).FirstOrDefault(); //_projectVM = _projectServiceLight.GetProjectModelWithQuote(user, _projectId, _quoteId).Model as ProjectViewModel; _projectVM = _projectService.GetProjectModel(user, _projectId).Model as ProjectModel; }