Пример #1
0
        public void Create(TestTarget item)
        {
            item.DateCreated = DateTime.Now;
            item.DateModified = DateTime.Now;

            _session.Save(item);
        }
Пример #2
0
        public static void CreateTestEnvironment()
        {
            CleanUp();

            //some random objects
            foreach (var name in new[] { "Apple", "Apple Juice", "Banana", "Raw Potato", "Old Shoe", "Car", "Coffee" })
            {
                var item = new TestTarget {Name = name};
                _targetService.Create(item);
            }

            //some possible tags
            foreach (var text in new[] { "Food", "Yummy", "Expensive", "I need it!", "Liquid" })
            {
                var proto = new TagPrototype(typeof (TestTarget)) {Text = text};
                _prototypeService.Create(proto);
            }
        }