コード例 #1
0
ファイル: EntityTests.cs プロジェクト: skorunka/genitor
        public void Add_Entity_Set_CreatedOn()
        {
            using (var db = new EntityLocalizationTests.TestDataContext())
            {
                db.ReCreate();
                var entity = new NotLocalizedEntity {
                    Text = "Text"
                };

                db.NotLocalizedEntities.Add(entity);
                var entityLoaded = db.SaveAndLoadEntity(entity);

                Assert.IsTrue(entityLoaded.CreatedOnUtc <= DateTime.Now);
            }
        }
コード例 #2
0
        public void Add_NonLocalizable_Entity_Does_Not_Add_Localizations()
        {
            using (var db = new TestDataContext())
            {
                db.ReCreate();
                var entity = new NotLocalizedEntity {
                    Text = "Text"
                };

                db.NotLocalizedEntities.Add(entity);
                var entityLoaded = db.SaveAndLoadEntity(entity);

                Assert.AreSame(entity, entityLoaded);
                Assert.IsTrue(!db.Localizations.Any());
            }
        }