Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 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());
            }
        }