Exemplo n.º 1
0
        protected virtual void ScenarioSetup()
        {
            Context = new DefaultEntityContextFactory()
                      .WithMappings(_ => _.FromAssemblyOf <IComplexEntity>())
                      .Create();
            var entity = Context.Create <IComplexEntity>(new Iri("http://test.uri/entity"));

            entity.Floats.Add(0.1f);
            entity.Floats.Add(0.2f);
            entity.Doubles.Add(1.0);
            entity.Doubles.Add(2.0);
            entity.Related.Add(entity);
            entity.Other.Add(entity);
            Context.Commit();
        }
Exemplo n.º 2
0
        protected override void ScenarioSetup()
        {
            Context = new DefaultEntityContextFactory().Create();
            var primaryProduct = Context.Create <IUnmappedProduct>(new Iri("test"), MapPrimaryEntity);

            primaryProduct.Name        = "Product name";
            primaryProduct.Description = "Product description";
            primaryProduct.Categories.Add("category 1");
            var secondaryProduct = Context.Create <IUnmappedProduct>(new Iri("another"), MapSecondaryEntity);

            secondaryProduct.Name        = "Another product name";
            secondaryProduct.Description = "Product description";
            secondaryProduct.Categories.Add("category 1");
            secondaryProduct      = Context.Load <IUnmappedProduct>(new Iri("another"), AlternativeMapSecondaryEntity);
            secondaryProduct.Name = "Alternative product name";
            Context.Commit();
            Buffer = new MemoryStream();
        }
Exemplo n.º 3
0
 public void Setup()
 {
     Factory = new DefaultEntityContextFactory();
     ScenarioSetup();
     TheTest();
 }
Exemplo n.º 4
0
 protected override void ScenarioSetup()
 {
     Context = new DefaultEntityContextFactory().Create();
     Context.Commit();
 }
Exemplo n.º 5
0
 protected override void ScenarioSetup()
 {
     Context = new DefaultEntityContextFactory().Create();
     Context.UnmappedPropertyEncountered += OnUnmappedPropertyEncountered;
     ((ISerializableEntitySource)Context.EntitySource).Read(new StreamReader(typeof(when_deserializing).GetEmbeddedResource(".json")), new JsonLdReader());
 }