public static ClassWithValueProperties CreateAndFillValuePropertyObject()
        {
            ClassWithValueProperties instance = SimpleDomainObject <ClassWithValueProperties> .NewObject();

            instance.BoolProperty1  = true;
            instance.BoolProperty2  = false;
            instance.BoolProperty3  = true;
            instance.BoolProperty4  = false;
            instance.BoolProperty5  = true;
            instance.BoolProperty6  = false;
            instance.BoolProperty7  = true;
            instance.BoolProperty8  = false;
            instance.BoolProperty9  = true;
            instance.BoolProperty10 = false;

            instance.IntProperty1  = 0;
            instance.IntProperty2  = 1;
            instance.IntProperty3  = 2;
            instance.IntProperty4  = 3;
            instance.IntProperty5  = 4;
            instance.IntProperty6  = 5;
            instance.IntProperty7  = 6;
            instance.IntProperty8  = 7;
            instance.IntProperty9  = 8;
            instance.IntProperty10 = 9;

            instance.DateTimeProperty1  = new DateTime(2001, 01, 01, 01, 01, 01);
            instance.DateTimeProperty2  = new DateTime(2002, 01, 01, 01, 02, 02);
            instance.DateTimeProperty3  = new DateTime(2003, 01, 01, 01, 03, 03);
            instance.DateTimeProperty4  = new DateTime(2004, 01, 01, 01, 04, 04);
            instance.DateTimeProperty5  = new DateTime(2005, 01, 01, 01, 05, 05);
            instance.DateTimeProperty6  = new DateTime(2006, 01, 01, 01, 06, 06);
            instance.DateTimeProperty7  = new DateTime(2007, 01, 01, 01, 07, 07);
            instance.DateTimeProperty8  = new DateTime(2008, 01, 01, 01, 08, 08);
            instance.DateTimeProperty9  = new DateTime(2009, 01, 01, 01, 09, 09);
            instance.DateTimeProperty10 = new DateTime(2010, 01, 01, 01, 10, 10);

            instance.StringProperty1  = "One";
            instance.StringProperty2  = "Two";
            instance.StringProperty3  = "Three";
            instance.StringProperty4  = "Four";
            instance.StringProperty5  = "Five";
            instance.StringProperty6  = "Six";
            instance.StringProperty7  = "Seven";
            instance.StringProperty8  = "Eight";
            instance.StringProperty9  = "Nine";
            instance.StringProperty10 = "Ten";

            return(instance);
        }
示例#2
0
        private void CreateAndFillValuePropertyObject()
        {
            Random random = new Random();
            ClassWithValueProperties instance = ClassWithValueProperties.NewObject();

            instance.BoolProperty1  = random.Next() % 2 == 0;
            instance.BoolProperty2  = random.Next() % 2 == 0;
            instance.BoolProperty3  = random.Next() % 2 == 0;
            instance.BoolProperty4  = random.Next() % 2 == 0;
            instance.BoolProperty5  = random.Next() % 2 == 0;
            instance.BoolProperty6  = random.Next() % 2 == 0;
            instance.BoolProperty7  = random.Next() % 2 == 0;
            instance.BoolProperty8  = random.Next() % 2 == 0;
            instance.BoolProperty9  = random.Next() % 2 == 0;
            instance.BoolProperty10 = random.Next() % 2 == 0;

            instance.IntProperty1  = random.Next();
            instance.IntProperty2  = random.Next();
            instance.IntProperty3  = random.Next();
            instance.IntProperty4  = random.Next();
            instance.IntProperty5  = random.Next();
            instance.IntProperty6  = random.Next();
            instance.IntProperty7  = random.Next();
            instance.IntProperty8  = random.Next();
            instance.IntProperty9  = random.Next();
            instance.IntProperty10 = random.Next();

            instance.DateTimeProperty1  = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);
            instance.DateTimeProperty2  = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);
            instance.DateTimeProperty3  = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);
            instance.DateTimeProperty4  = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);
            instance.DateTimeProperty5  = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);
            instance.DateTimeProperty6  = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);
            instance.DateTimeProperty7  = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);
            instance.DateTimeProperty8  = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);
            instance.DateTimeProperty9  = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);
            instance.DateTimeProperty10 = new DateTime(random.Next() % 2000 + 1000, random.Next() % 12 + 1, random.Next() % 28 + 1);

            instance.StringProperty1  = Guid.NewGuid().ToString();
            instance.StringProperty2  = Guid.NewGuid().ToString();
            instance.StringProperty3  = Guid.NewGuid().ToString();
            instance.StringProperty4  = Guid.NewGuid().ToString();
            instance.StringProperty5  = Guid.NewGuid().ToString();
            instance.StringProperty6  = Guid.NewGuid().ToString();
            instance.StringProperty7  = Guid.NewGuid().ToString();
            instance.StringProperty8  = Guid.NewGuid().ToString();
            instance.StringProperty9  = Guid.NewGuid().ToString();
            instance.StringProperty10 = Guid.NewGuid().ToString();
        }