public void DeleteOrphans()
        {
            using (var api = new Api(GetDb(), null)) {
                var builder = new PageTypeBuilder(api)
                              .AddType(typeof(SimplePageType))
                              .AddType(typeof(ComplexPageType));
                builder.Build();

                Assert.Equal(2, api.PageTypes.GetAll().Count());

                builder = new PageTypeBuilder(api)
                          .AddType(typeof(SimplePageType));
                builder.DeleteOrphans();

                Assert.Single(api.PageTypes.GetAll());
            }
        }
Beispiel #2
0
        public async Task DeleteOrphans()
        {
            using (var api = CreateApi())
            {
                var builder = new PageTypeBuilder(api)
                              .AddType(typeof(SimplePageType))
                              .AddType(typeof(ComplexPageType));
                builder.Build();

                Assert.Equal(2, (await api.PageTypes.GetAllAsync()).Count());

                builder = new PageTypeBuilder(api)
                          .AddType(typeof(SimplePageType));
                builder.DeleteOrphans();

                Assert.Single(await api.PageTypes.GetAllAsync());
            }
        }