public void SingleArgumentConstructor(int iterations) { for (int i = 0; i < iterations; i++) { ClassWithOneConstructorArg item = FastActivator <ClassWithOneConstructorArg> .Create(47); } }
public void SingleArgumentConstructor(int iterations) { for (int i = 0; i < iterations; i++) { var item = new ClassWithOneConstructorArg(47); } }
public void Using_object_generator_with_one_argument() { Trace.WriteLine("Using FastActivator(47)"); for (int i = 0; i < Iterations; i++) { ClassWithOneConstructorArg item = FastActivator <ClassWithOneConstructorArg> .Create(47); } }
public void Using_new_with_one_argument() { Trace.WriteLine("Using new(47)"); for (int i = 0; i < Iterations; i++) { var item = new ClassWithOneConstructorArg(47); } }
public void The_object_should_be_created_with_a_null_argument() { _instance = FastActivator <ClassWithOneConstructorArg> .Create <string>(null); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf <ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(default(int)); _instance.Name.ShouldEqual(null); }
public void The_object_should_be_created_with_a_null_argument_via_type() { _instance = (ClassWithOneConstructorArg)FastActivator.Create(typeof(ClassWithOneConstructorArg), new object[] { null }); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf <ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(default(int)); _instance.Name.ShouldEqual(null); }
public void The_object_should_be_created_with_a_null_argument_via_type() { _instance = (ClassWithOneConstructorArg)FastActivator.Create(typeof(ClassWithOneConstructorArg), new object[]{null}); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf<ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(default(int)); _instance.Name.ShouldEqual(null); }
public void The_object_should_be_created_with_a_null_argument() { _instance = FastActivator<ClassWithOneConstructorArg>.Create<string>(null); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf<ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(default(int)); _instance.Name.ShouldEqual(null); }
public void The_object_should_be_created_with_the_name() { const string expected = "The Name"; _instance = FastActivator <ClassWithOneConstructorArg> .Create(expected); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf <ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(default(int)); _instance.Name.ShouldEqual(expected); }
public void The_object_should_be_created() { const int expected = 47; _instance = FastActivator <ClassWithOneConstructorArg> .Create(expected); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf <ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(expected); _instance.Name.ShouldBeNull(); }
public void The_object_should_be_created_with_the_name() { const string expected = "The Name"; _instance = FastActivator<ClassWithOneConstructorArg>.Create(expected); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf<ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(default(int)); _instance.Name.ShouldEqual(expected); }
public void The_object_should_be_created() { const int expected = 47; _instance = FastActivator<ClassWithOneConstructorArg>.Create(expected); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf<ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(expected); _instance.Name.ShouldBeNull(); }
public void The_object_should_be_created_with_the_id() { Guid expected = CombGuid.Generate(); _instance = FastActivator <ClassWithOneConstructorArg> .Create(expected); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf <ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(default(int)); _instance.Name.ShouldBeNull(); _instance.Id.ShouldEqual(expected); }
public void The_object_should_be_created_with_the_id() { Guid expected = CombGuid.Generate(); _instance = FastActivator<ClassWithOneConstructorArg>.Create(expected); _instance.ShouldNotBeNull(); _instance.ShouldBeAnInstanceOf<ClassWithOneConstructorArg>(); _instance.Value.ShouldEqual(default(int)); _instance.Name.ShouldBeNull(); _instance.Id.ShouldEqual(expected); }