public void Setup() { mockedUser = UserHelper.Create(); mockedPage = PageHelper.Create(); mockedFeatures = FeatureHelper.CreateList(5); mockedPage.Features = mockedFeatures; mockedUser.Accesses = new List <UserAccess>(); FeatureHelper.CreateFeatureAccess(mockedFeatures, mockedPage, mockedUser, AccessType.Read_Write); }
public void Setup() { testDbContext = Substitute.For <IDbDataContext>(); testUserService = Substitute.For <IUserService>(); pageService = new PageService(testDbContext, testUserService); mockedPage = PageHelper.Create(); mockedUser = UserHelper.Create(); mockedUser.Accesses = new List <UserAccess>(); mockedFeatures = FeatureHelper.CreateList(3); FeatureHelper.CreateFeatureAccess(mockedFeatures, mockedPage, mockedUser, AccessType.None); mockedPage.Features = mockedFeatures; testUserService.GetUserByUserName(mockedUser.UserName).Returns(mockedUser); mockedPage.PageName = "Index"; mockedPages = new List <Page>() { mockedPage }.AsQueryable(); testDbContext.Pages.Returns(mockedPages); }