Beispiel #1
0
        static User CreateBob()
        {
            User bob = new User {
                Username = "******",
                Hash = new Byte[] { 0, 1, 2, 3, 4, 5 },
                Salt = new Byte[] { 6, 7, 8, 9, 10, 0xA }
                #if ENTITY
                ,Things = new HashSet<Thing>()
                #endif
            };
            Thing camery;
            bob.Things.Add(camery = new Thing {
                Owner = bob,
                Name = "1992 Toyota Camery"
                #if ENTITY
                ,Events = new List<Event>()
                #endif
            });

            Work changeOil = new Work {
                Name = "Oil Change",
                EveryCounter = 3000
                #if ENTITY
                ,Instances = new List<Event>()
                #endif
            };
            Work changeAlternator = new Work {
                Name = "Alternator Change"
                #if ENTITY
                ,Instances = new List<Event>()
                #endif
            };

            camery.Serviced(new Event {
                Name = "Serviced at Roger's",
                Date = DateTime.Now.Date,
                Counter = 100005
                #if ENTITY
                ,WorkDone = new List<Work>()
                #endif
            })
            .HadWorkDown(changeOil)
            .HadWorkDown(changeAlternator);

            return bob;
        }