public ContentsController(
     ICommandBus commandBus,
     ISchemaProvider schemas,
     IContentRepository contentRepository,
     IGraphQLInvoker graphQL)
     : base(commandBus)
 {
     this.graphQL           = graphQL;
     this.schemas           = schemas;
     this.contentRepository = contentRepository;
 }
Example #2
0
        public GraphQLTests()
        {
            var appEntity = new Mock<IAppEntity>();
            appEntity.Setup(x => x.Id).Returns(appId);
            appEntity.Setup(x => x.PartitionResolver).Returns(x => InvariantPartitioning.Instance);

            app = appEntity.Object;

            var schemaEntity = new Mock<ISchemaEntity>();
            schemaEntity.Setup(x => x.Id).Returns(schemaId);
            schemaEntity.Setup(x => x.Name).Returns(schema.Name);
            schemaEntity.Setup(x => x.Schema).Returns(schema);
            schemaEntity.Setup(x => x.IsPublished).Returns(true);

            var schemas = new List<ISchemaEntity> { schemaEntity.Object };

            schemaRepository.Setup(x => x.QueryAllAsync(appId)).Returns(Task.FromResult<IReadOnlyList<ISchemaEntity>>(schemas));

            sut = new CachingGraphQLInvoker(cache, schemaRepository.Object, assetRepository.Object, contentRepository.Object);
        }