private ITecture Configure() { var tb = new TectureBuilder(); CommandAspect = new Aspect101.Command(); tb.WithChannel <Test>(x => { x.ForCommand(CommandAspect); x.ForQuery(new Aspect101.Query()); }); tb.WithExceptionHandler(e => true); return(tb.Build()); }
public void Tecture_Returns_Specified_Query_Aspect_On_Aspect_Call() { var tb = new TectureBuilder(); var commandAspect = new Aspect101.Command(); var queryAspect = new Aspect101.Query(); tb.WithChannel <Test>(x => { x.ForCommand(commandAspect); x.ForQuery(queryAspect); }); var tecture = tb.Build(); Assert.Equal(commandAspect, tecture.Let <Service2>().GetTestCommandAspect()); Assert.Equal(commandAspect, tecture.Let <Service2>().GetTestCommandAspect()); Assert.Equal(queryAspect, tecture.Let <Service2>().GetTestQueryAspect()); Assert.Equal(queryAspect, tecture.Let <Service2>().GetTestQueryAspect()); }