public void Should_Create_Objects_Via_Constructor() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf <Car>(new { Make = "Toyota" }); Assert.AreEqual("Toyota", testPlant.Create <Car>().Make); }
public void Should_Override_Default_Constructor_Arguments() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf <House>(new { Color = "Red", SquareFoot = 3000 }); Assert.AreEqual("Blue", testPlant.Create <House>(new { Color = "Blue" }).Color); }
public void Should_Send_Constructor_Arguments_In_Correct_Order() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf <Book>(new { Publisher = "Tor", Author = "Robert Jordan" }); Assert.AreEqual("Tor", testPlant.Create <Book>().Publisher); Assert.AreEqual("Robert Jordan", testPlant.Create <Book>().Author); }
public void Should_Call_AfterBuildCallback_AfterConstructor_Population() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf<House>(new { Color = "Red", SquareFoot = 3000 }, (h) => h.Summary = h.Color + h.SquareFoot); Assert.AreEqual("Blue3000", testPlant.Create<House>(new { Color = "Blue" }).Summary); }
public void Should_Call_AfterBuildCallback_AfterConstructor_Population() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf <House>(new { Color = "Red", SquareFoot = 3000 }, (h) => h.Summary = h.Color + h.SquareFoot); Assert.AreEqual("Blue3000", testPlant.Create <House>(new { Color = "Blue" }).Summary); }
public void Should_increment_values_in_a_sequence_with_ctor_construction() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf <House>(new { Color = new Sequence <string>((i) => "Color" + i), SquareFoot = 10 }); Assert.AreEqual("Color0", testPlant.Create <House>().Color); Assert.AreEqual("Color1", testPlant.Create <House>().Color); }
public void Should_Send_Constructor_Arguments_In_Correct_Order() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf<Book>(new { Publisher = "Tor", Author = "Robert Jordan" }); Assert.AreEqual("Tor", testPlant.Create<Book>().Publisher); Assert.AreEqual("Robert Jordan", testPlant.Create<Book>().Author); }
public void Should_Override_Default_Constructor_Arguments() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf<House>(new { Color = "Red", SquareFoot = 3000 }); Assert.AreEqual("Blue", testPlant.Create<House>(new { Color = "Blue" }).Color); }
public void Should_increment_values_in_a_sequence_with_ctor_construction() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf<House>(new { Color = new Sequence<string>(i => "Color" + i), SquareFoot = 10 }); Assert.AreEqual("Color0", testPlant.Create<House>().Color); Assert.AreEqual("Color1", testPlant.Create<House>().Color); }
public void Should_Create_Objects_Via_Constructor() { var testPlant = new BasePlant(); testPlant.DefineConstructionOf<Car>(new { Make = "Toyota" }); Assert.AreEqual("Toyota", testPlant.Create<Car>().Make); }