public void should_be_case_sensitive()
        {
            var registry = new BlueprintRegistry();

            registry.OmitIds();
            var construktion = new Construktion().AddRegistry(registry);

            var foo = construktion.Construct <Foo>();

            foo.Fooid.ShouldNotBe(0);
        }
        public void should_be_able_to_define_a_custom_convention()
        {
            var registry = new BlueprintRegistry();

            registry.OmitProperties(x => x.EndsWith("_Id"), typeof(string));
            var construktion = new Construktion().AddRegistry(registry);

            var foo = construktion.Construct <Foo>();

            foo.String_Id.ShouldBe(null);
        }
Exemplo n.º 3
0
        public void should_construct_graph_and_auto_properties()
        {
            var registry = new BlueprintRegistry();

            registry.Register <IFoo, Foo>();
            registry.Register <IBar, Bar>();
            var construktion = new Construktion().AddRegistry(registry);

            var bar = construktion.Construct <IBar>();

            bar.Name.ShouldNotBeNullOrWhiteSpace();
            bar.Age.ShouldNotBe(0);
            bar.Foo.Name.ShouldNotBeNullOrWhiteSpace();
            bar.Foo.Age.ShouldNotBe(0);
        }
Exemplo n.º 4
0
 public BlueprintRegistryTests()
 {
     _registry = new BlueprintRegistry();
 }