mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 02:44:52 +08:00
Updating UT handlers.
--HG-- branch : 1.x
This commit is contained in:
@@ -4,13 +4,9 @@ using Orchard.Tests.ContentManagement.Models;
|
||||
namespace Orchard.Tests.ContentManagement.Handlers {
|
||||
public class AlphaPartHandler : ContentHandler {
|
||||
public AlphaPartHandler() {
|
||||
Filters.Add(new ActivatingFilter<AlphaPart>("alpha"));
|
||||
|
||||
OnGetDisplayShape<AlphaPart>((ctx, part) => ctx.Shape.Zones["Main"].Add(part, "3"));
|
||||
}
|
||||
|
||||
protected override void Activating(ActivatingContentContext context) {
|
||||
if (context.ContentType == "alpha") {
|
||||
context.Builder.Weld<AlphaPart>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,10 +3,8 @@ using Orchard.Tests.ContentManagement.Models;
|
||||
|
||||
namespace Orchard.Tests.ContentManagement.Handlers {
|
||||
public class BetaPartHandler : ContentHandler {
|
||||
protected override void Activating(ActivatingContentContext context) {
|
||||
if (context.ContentType == "beta") {
|
||||
context.Builder.Weld<BetaPart>();
|
||||
}
|
||||
public BetaPartHandler() {
|
||||
Filters.Add(new ActivatingFilter<BetaPart>("beta"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ using Orchard.Tests.ContentManagement.Records;
|
||||
namespace Orchard.Tests.ContentManagement.Handlers {
|
||||
public class DeltaPartHandler : ContentHandler {
|
||||
public DeltaPartHandler(IRepository<DeltaRecord> repository) {
|
||||
Filters.Add(new ActivatingFilter<DeltaPart>(x => x == "delta"));
|
||||
Filters.Add(new ActivatingFilter<DeltaPart>("delta"));
|
||||
Filters.Add(StorageFilter.For(repository));
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ using Orchard.Tests.ContentManagement.Models;
|
||||
namespace Orchard.Tests.ContentManagement.Handlers {
|
||||
public class EpsilonPartHandler : ContentHandler {
|
||||
public EpsilonPartHandler(IRepository<EpsilonRecord> repository) {
|
||||
Filters.Add(new ActivatingFilter<EpsilonPart>(x => x == "gamma"));
|
||||
Filters.Add(new ActivatingFilter<EpsilonPart>("gamma"));
|
||||
Filters.Add(StorageFilter.For(repository));
|
||||
}
|
||||
}
|
||||
|
@@ -4,12 +4,10 @@ using Orchard.Tests.ContentManagement.Models;
|
||||
namespace Orchard.Tests.ContentManagement.Handlers {
|
||||
public class FlavoredPartHandler : ContentHandler {
|
||||
public FlavoredPartHandler() {
|
||||
Filters.Add(new ActivatingFilter<FlavoredPart>("alpha"));
|
||||
Filters.Add(new ActivatingFilter<FlavoredPart>("beta"));
|
||||
|
||||
OnGetDisplayShape<FlavoredPart>((ctx, part) => ctx.Shape.Zones["Main"].Add(part));
|
||||
}
|
||||
protected override void Activating(ActivatingContentContext context) {
|
||||
if (context.ContentType == "beta" || context.ContentType == "alpha") {
|
||||
context.Builder.Weld<FlavoredPart>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ using Orchard.Tests.ContentManagement.Records;
|
||||
namespace Orchard.Tests.ContentManagement.Handlers {
|
||||
class GammaPartHandler : ContentHandler {
|
||||
public GammaPartHandler(IRepository<GammaRecord> repository) {
|
||||
Filters.Add(new ActivatingFilter<GammaPart>(x => x == "gamma"));
|
||||
Filters.Add(new ActivatingFilter<GammaPart>("gamma"));
|
||||
Filters.Add(StorageFilter.For(repository));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user