コード例 #1
0
ファイル: LinqTestsBase.cs プロジェクト: nikita239/Aspect
        public override void SetUp()
        {
            base.SetUp();

            CreateDatabaseSchema();

            root                  = CreateOneItem <LinqItem>(0, "root", null);
            root.State            = ContentState.Published;
            root.StringProperty   = "a string";
            root.StringProperty2  = "another string";
            root.IntProperty      = 123;
            root.DateTimeProperty = now = N2.Utility.CurrentTime();
            root.DoubleProperty   = 345.678;
            root.BooleanProperty  = true;
            root.GetDetailCollection("CollectionProperty", true).AddRange(new[] { "hello", "world" });
            engine.Persister.Repository.SaveOrUpdate(root);

            item = CreateOneItem <LinqItem>(0, "item", null);
            item.StringProperty      = "a string";
            item.StringProperty2     = "yet another string";
            item.IntProperty         = 234;
            item.DateTimeProperty    = now.AddDays(-1);
            item.DoubleProperty      = 123456789;
            item.BooleanProperty     = false;
            item.ContentItemProperty = root;
            item.ZoneName            = "Hello";
            item.AddTo(root);

            engine.Persister.Repository.SaveOrUpdate(item);
        }
コード例 #2
0
ファイル: LinqTestsBase.cs プロジェクト: joaohortencio/n2cms
        public override void SetUp()
        {
            base.SetUp();

            CreateDatabaseSchema();

            root = CreateOneItem<LinqItem>(0, "root", null);
            root.StringProperty = "a string";
            root.StringProperty2 = "another string";
            root.IntProperty = 123;
            root.DateTimeProperty = now = DateTime.Now;
            root.DoubleProperty = 345.678;
            root.BooleanProperty = true;

            item = CreateOneItem<LinqItem>(0, "item", null);
            item.StringProperty = "a string";
            item.StringProperty2 = "yet another string";
            item.IntProperty = 234;
            item.DateTimeProperty = now.AddDays(-1);
            item.DoubleProperty = 123456789;
            item.BooleanProperty = false;
            item.ContentItemProperty = root;

            engine.Persister.Repository.Save(root);
            engine.Persister.Repository.Save(item);

            Debug.WriteLine("===== Starting Test =====");
        }
コード例 #3
0
		public override void SetUp()
		{
			base.SetUp();

			CreateDatabaseSchema();

			root = CreateOneItem<LinqItem>(0, "root", null);
			root.State = ContentState.Published;
			root.StringProperty = "a string";
			root.StringProperty2 = "another string";
			root.IntProperty = 123;
			root.DateTimeProperty = now = N2.Utility.CurrentTime();
			root.DoubleProperty = 345.678;
			root.BooleanProperty = true;
			root.GetDetailCollection("CollectionProperty", true).AddRange(new[] { "hello", "world" });
			engine.Persister.Repository.SaveOrUpdate(root);

			item = CreateOneItem<LinqItem>(0, "item", null);
			item.StringProperty = "a string";
			item.StringProperty2 = "yet another string";
			item.IntProperty = 234;
			item.DateTimeProperty = now.AddDays(-1);
			item.DoubleProperty = 123456789;
			item.BooleanProperty = false;
			item.ContentItemProperty = root;
			item.ZoneName = "Hello";
			item.AddTo(root);

			engine.Persister.Repository.SaveOrUpdate(item);
		}
コード例 #4
0
        public override void SetUp()
        {
            base.SetUp();

            CreateDatabaseSchema();

            root = CreateOneItem <LinqItem>(0, "root", null);
            root.StringProperty   = "a string";
            root.StringProperty2  = "another string";
            root.IntProperty      = 123;
            root.DateTimeProperty = now = DateTime.Now;
            root.DoubleProperty   = 345.678;
            root.BooleanProperty  = true;

            item = CreateOneItem <LinqItem>(0, "item", null);
            item.StringProperty      = "a string";
            item.StringProperty2     = "yet another string";
            item.IntProperty         = 234;
            item.DateTimeProperty    = now.AddDays(-1);
            item.DoubleProperty      = 123456789;
            item.BooleanProperty     = false;
            item.ContentItemProperty = root;

            engine.Persister.Repository.Save(root);
            engine.Persister.Repository.Save(item);

            Debug.WriteLine("===== Starting Test =====");
        }