public ContentCommandMiddlewareTests()
        {
            var schemaDef =
                new Schema("my-schema")
                .AddField(new NumberField(1, "my-field1", Partitioning.Invariant,
                                          new NumberFieldProperties {
                IsRequired = true
            }))
                .AddField(new NumberField(2, "my-field2", Partitioning.Invariant,
                                          new NumberFieldProperties {
                IsRequired = false
            }));

            sut = new ContentCommandMiddleware(Handler, appProvider, A.Dummy <IAssetRepository>(), scriptEngine, A.Dummy <IContentRepository>());

            A.CallTo(() => app.LanguagesConfig).Returns(languagesConfig);

            A.CallTo(() => appProvider.GetAppAsync(AppName)).Returns(app);

            A.CallTo(() => schema.SchemaDef).Returns(schemaDef);
            A.CallTo(() => schema.ScriptCreate).Returns("<create-script>");
            A.CallTo(() => schema.ScriptChange).Returns("<change-script>");
            A.CallTo(() => schema.ScriptUpdate).Returns("<update-script>");
            A.CallTo(() => schema.ScriptDelete).Returns("<delete-script>");

            A.CallTo(() => appProvider.GetAppWithSchemaAsync(AppId, SchemaId)).Returns((app, schema));
        }
Ejemplo n.º 2
0
        public ContentCommandMiddlewareTests()
        {
            A.CallTo(() => contextProvider.Context)
            .Returns(requestContext);

            sut = new ContentCommandMiddleware(A.Fake <IGrainFactory>(), contentEnricher, contextProvider);
        }
Ejemplo n.º 3
0
 public ContentCommandMiddlewareTests()
 {
     sut = new ContentCommandMiddleware(A.Fake <IGrainFactory>(), contentEnricher);
 }