public static ISiteBuilder <T> CreateSite <T>(this EpiserverFixture fixture, CultureInfo[] cultures, Action <T> build = null) where T : PageData
        {
            fixture.Cultures.Clear();
            fixture.Cultures.AddRange(cultures);

            return(new PageBuilder <T>(fixture).Create <T>(build).CreateSite(fixture));
        }
        public static IPageBuilder <T> Update <T>(this EpiserverFixture fixture, Action <T> build) where T : PageData
        {
            var contents = fixture.Contents.Where(c => c is T).Select(c => (T)c).ToList();

            fixture.Add(contents);

            return(new PageBuilder <T>(fixture).Update(build));
        }
        public static IPageBuilder <T> Get <T>(this EpiserverFixture fixture) where T : PageData
        {
            var contents = fixture.Contents.Where(c => c is T).Select(c => (T)c).ToList();

            fixture.Add(contents);

            return(new PageBuilder <T>(fixture));
        }
        public static IBlockBuilder <TBlockType> CreateBlock <TBlockType, TPageType>(this EpiserverFixture fixture, Action <TBlockType, TPageType> build)
            where TBlockType : BlockData where TPageType : PageData
        {
            var page         = fixture.Get <TPageType>().Last();
            var blockBuilder = fixture.Get <TPageType>().CreateBlock <TBlockType>((b) => build.Invoke(b, page));
            var latest       = fixture.Latest.Last();

            var pageBuilder = new PageBuilder <TPageType>(fixture).Update(page);

            fixture.Add(latest);

            return(blockBuilder);
        }
示例#5
0
 public BlockBuilder(EpiserverFixture fixture)
     : base(fixture)
 {
 }
示例#6
0
 public BlockBuilder(EpiserverFixture fixture, IEnumerable <BlockData> blocks)
     : base(fixture, blocks.Select(b => (IContent)b))
 {
 }
示例#7
0
 public FixtureBuilder(EpiserverFixture fixture)
 {
     Fixture = fixture;
 }
示例#8
0
        public FixtureBuilder(EpiserverFixture fixture, IEnumerable <IContent> latest)
        {
            Fixture = fixture;

            Fixture.Add(latest);
        }
 public static IMediaBuilder <TMediaType> Upload <TMediaType>(this EpiserverFixture fixture, string file, Action <TMediaType> build = null) where TMediaType : MediaData
 => new MediaBuilder <TMediaType>(fixture).Upload(file, build);
 public static ISiteBuilder <T> CreateSite <T>(this EpiserverFixture fixture, Action <T> build = null) where T : PageData
 => new PageBuilder <T>(fixture).Create <T>(build).CreateSite(fixture);
 public MediaBuilder(EpiserverFixture fixture)
     : base(fixture)
 {
 }
 public ContentBuilder(EpiserverFixture fixture, IEnumerable <IContent> latest)
     : base(fixture, latest)
 {
 }
 public PageBuilder(EpiserverFixture fixture)
     : base(fixture)
 {
 }
 public static ISiteBuilder <T> CreateSite <T>(this IPageBuilder <T> _, EpiserverFixture fixture)
     where T : PageData => new SiteBuilder <T>(fixture).CreateSite();
 public static IPageBuilder <T> CreatePath <T>(this EpiserverFixture fixture, int depth, Action <T> build = null) where T : PageData
 => new PageBuilder <T>(fixture).CreatePath(depth, build);
 public static IPageBuilder <T> CreateMany <T>(this EpiserverFixture fixture, int total, Action <T, int> build = null) where T : PageData
 => new PageBuilder <T>(fixture).CreateMany(total, build);
 public static ISiteBuilder <T> CreateSite <T>(this IPageBuilder <T> _, EpiserverFixture fixture, string name, string url)
     where T : PageData => new SiteBuilder <T>(fixture).CreateSite(name, url);
 public PageBuilder(EpiserverFixture fixture, IEnumerable <PageData> pages)
     : base(fixture, pages)
 {
 }
 public static IBlockBuilder <TBlockType> CreateBlock <TBlockType>(this EpiserverFixture fixture, Action <TBlockType> build = null)
     where TBlockType : BlockData => new BlockBuilder <TBlockType>(fixture).CreateBlock(build);
 public MediaBuilder(EpiserverFixture fixture, IEnumerable <MediaData> medias)
     : base(fixture, medias)
 {
 }
 public ContentBuilder(EpiserverFixture fixture)
     : base(fixture)
 {
 }