public async Task PageServiceAddWithParentTest() { //arrange var userManager = AppObjectFactory.GetContainer().GetInstance <IAppUserManager>(); var identity = new ClaimsIdentity(); identity.AddClaim(new Claim(CustomClaimTypes.Premission, PagePremision.CanManage)); identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, (await userManager.FindByNameAsync("mohammadali")).Id.ToString())); var principal = new ClaimsPrincipal(identity); var pageAddRequest = new PageAddRequest() { RequestOwner = principal, ViewModel = new PageAddUpdateViewModel() { Handle = "contactus", UrlSegment = "/contactus", Title = "تماس با ما", LanguageName = "fa-IR", Description = "test", HtmlContent = "<h1>hello</h1>", ParentId = Guid.Parse("5040e22d-739f-404a-9762-9da3f4ca7e22") } }; AutomapperConfiguration.Cofigure(AppObjectFactory.GetContainer()); var service = AppObjectFactory.GetContainer().GetInstance <IPageService>(); var res = service.Add(pageAddRequest); Assert.AreEqual((await res).Access, ResponseAccess.Granted); }
public async Task LoadTimeByOptionsTest() { var productDataService = AppObjectFactory.GetContainer().GetInstance <IProductDataService>(); AutomapperConfiguration.Cofigure(AppObjectFactory.GetContainer()); var stopWatch = new Stopwatch(); stopWatch.Start(); var product = productDataService.Query.IncludeNecessaryData() .FirstOrDefault(); await product.LoadDataByOptionsAsync(AppObjectFactory.GetContainer().GetInstance <IUnitOfWork>()); stopWatch.Stop(); Console.Write(stopWatch.Elapsed + " elapsed"); }
public async Task MappingTimeTest() { var productDataService = AppObjectFactory.GetContainer().GetInstance <IProductDataService>(); var stopWatch = new Stopwatch(); var product = productDataService.Query.IncludeNecessaryData().Include(x => x.PrimaryCategory) .Include(x => x.PrimaryCategory.FieldDefenitions) .Include(x => x.PrimaryCategory.FieldDefenitionGroups) .Include(x => x.PrimaryCategory.FieldDefenitionGroups.Select(fdg => fdg.FieldDefenitions)) .Include(x => x.Scheme) .Include(x => x.Scheme.FieldDefenitions) .Include(x => x.Scheme.FieldDefenitionGroups) .Include(x => x.Scheme.FieldDefenitionGroups.Select(fdg => fdg.FieldDefenitions)).FirstOrDefault(); AutomapperConfiguration.Cofigure(AppObjectFactory.GetContainer()); stopWatch.Start(); Mapper.Map <ProductViewModel>(product); stopWatch.Stop(); Console.Write(stopWatch.Elapsed + " elapsed"); }
public EntitySchemeFacadeTests() { AutomapperConfiguration.Cofigure(AppObjectFactory.GetContainer()); }
public MenuServiceTests() { AutomapperConfiguration.Cofigure(AppObjectFactory.GetContainer()); }
public UnitTest1() { AutomapperConfiguration.Cofigure(AppObjectFactory.GetContainer()); }