public void GetSchema()
        {
            var name   = _fixture.Create <string>();
            var schema = _schemaRegistryService.AddSchema(
                name,
                _fixture.Create <GeneralObject>().ToJSONString(),
                SchemaType.Types.Type.DocumentStorage
                ).Result;
            var results = _schemaRegistryService.GetFullSchema(schema.Id_).Result;

            Assert.IsType <FullSchema>(results);
            Assert.Contains(results.Name, name);
        }
        public async void MaterializerOnDemand()
        {
            var name       = _fixture.Create <string>();
            var objectId_a = Guid.NewGuid().ToString();
            var payload_a  = _fixture.Create <Person>();
            var viewName   = _fixture.Create <string>();
            var schema_a   = _schemaRegistryService.AddSchema(
                name,
                _fixture.Create <GeneralObject>().ToJSONString(),
                SchemaType.Types.Type.DocumentStorage).Result;
            var viewFields      = new Dictionary <string, object>();
            var relation        = _edgeRegistryService.AddRelation(schema_a.Id_, schema_a.Id_).Result;
            var relationForView = new List <Relation>();

            relationForView.Add(new Relation()
            {
                GlobalId  = relation.RelationId_,
                LocalId   = _fixture.Create <UInt32>(),
                SearchFor = new SearchFor()
                {
                    SearchFor_ = SearchFor.Types.Direction.Children,
                }
            });

            viewFields.Add("firstName", new SimpleFiled()
            {
                simple = new SimpleItem()
                {
                    field_name = "firstName",
                    field_type = "String"
                }
            });
            viewFields.Add("lastName", new SimpleFiled()
            {
                simple = new SimpleItem()
                {
                    field_name = "lastName",
                    field_type = "String"
                }
            });
            var view           = _schemaRegistryService.AddViewToSchema(schema_a.Id_, viewName, viewFields, new List <Relation>()).Result;
            var viewDetails    = _schemaRegistryService.GetView(view.Id_).Result;
            var schemaWithView = _schemaRegistryService.GetFullSchema(schema_a.Id_).Result;

            Assert.True(schemaWithView.Views.Count == 1);

            _kafkaProducer.Produce(new InsertObject()
            {
                schemaId = schema_a.Id_,
                objectId = objectId_a,
                data     = payload_a
            }).Wait();
            Thread.Sleep(1000);

            var res = _onDemandMaterializerService.Materialize(view.Id_, new List <string>()
            {
                schema_a.Id_
            });

            //should have only one row
            while (await res.ResponseStream.MoveNext())
            {
                Assert.True(res.ResponseStream.Current.Fields.Count == 2);
                Assert.Contains(payload_a.FirstName, res.ResponseStream.Current.Fields["firstName"]);
                Assert.Contains(payload_a.LastName, res.ResponseStream.Current.Fields["lastName"]);
            }
        }