Esempio n. 1
0
        public void SaveMyEntityShouldReturnValueUpdated()
        {
            var          contextGenerator = new DbContextGenerator(options);
            var          manager          = new MyEntityManager(contextGenerator);
            const string nameToUpdate     = "INTEGRATION TEST";

            var entity        = manager.GetMyEntity();
            var originalValue = entity.Name;

            entity.Name = nameToUpdate;
            manager.SaveMyEntity(entity);
            var entitySaved = manager.GetMyEntity();

            Assert.NotNull(entity);
            Assert.NotNull(entitySaved);
            Assert.AreEqual(entity.Name, entitySaved.Name);
            Assert.AreEqual(nameToUpdate, entitySaved.Name);

            entitySaved.Name = originalValue;
            manager.SaveMyEntity(entitySaved);
        }
Esempio n. 2
0
        public void SaveConfigurationShouldReturnValueUpdated()
        {
            var manager = new MyEntityManager(contextGenerator);

            var entity = manager.GetMyEntity();

            entity.Name = "TEST UPDATE";
            manager.SaveMyEntity(entity);
            var entitySaved = manager.GetMyEntity();

            Assert.NotNull(entity);
            Assert.NotNull(entitySaved);
            Assert.AreEqual(entity.Name, entitySaved.Name);
            Assert.AreEqual("TEST UPDATE", entitySaved.Name);
        }