public void CanQueryDatabase() { ServiceLocatorInitializer.Init(); IRepository <CmsPersistentVariable> repository = new Repository <CmsPersistentVariable>(); IList <CmsPersistentVariable> persistentvariables = repository.GetAll(); Assert.IsNotNull(persistentvariables); Assert.That(persistentvariables, Is.Not.Empty); }
public void CanInsertLongBlobtoDatabase() { ServiceLocatorInitializer.Init(); IRepository <CmsPersistentVariable> repository = new Repository <CmsPersistentVariable>(); IList <CmsPersistentVariable> persistentvariables = repository.GetAll(); Assert.IsNotNull(persistentvariables); Assert.That(persistentvariables, Is.Not.Empty); CmsPersistentVariable insertvariable = new CmsPersistentVariable(); insertvariable.Name = "This is a test variable for long blob type"; insertvariable.PersistedValue = persistentvariables[0].PersistedValue; Assert.That(insertvariable, Is.Not.Null); CmsPersistentVariable returnvariable = repository.SaveOrUpdate(insertvariable); IList <CmsPersistentVariable> newvariables = repository.GetAll(); Assert.That(newvariables.Count, Is.EqualTo(4)); }