public void Can_Create_Class_With_Specific_Parameter_Value()
    {
        string  wanted  = "This is the first string";
        string  wanted2 = "This is the second string";
        Fixture fixture = new Fixture();

        fixture.ConstructorArgumentFor <TestClass <string>, string>("value1", wanted)
        .ConstructorArgumentFor <TestClass <string>, string>("value2", wanted2);

        TestClass <string>    t = fixture.Create <TestClass <string> >();
        SimilarClass <string> s = fixture.Create <SimilarClass <string> >();

        Assert.AreEqual(wanted, t.Value1);
        Assert.AreEqual(wanted2, t.Value2);
        Assert.AreNotEqual(wanted, s.Value1);
        Assert.AreNotEqual(wanted2, s.Value2);
    }
Exemple #2
0
 public SimilarHost(SimilarClass classToAdd)
 {
     Classes.Add(classToAdd);
 }