public void UpdateSystemConfiguration_when_cacheprovider_is_not_null_sets_updatedsystemconfiguration_setting_id_1_in_cache() { //arrange var sysconfig = new SystemConfigurationObject() { SettingId = 1 }; _repository.Add(sysconfig); var sysConfigToUpdate = new SystemConfigurationObject() { SettingId = 1, CouncilName = "test" }; var mut = new SystemConfigurationService(_repository, _fakecacheprovider); //act mut.UpdateSystemConfigurations(sysConfigToUpdate); SystemConfigurationObject resultObj; _fakecacheprovider.Get("GetSystemConfigurations", out resultObj); //assert Assert.AreEqual(sysconfig, resultObj); //cleanup _repository.Delete(sysconfig); _fakecacheprovider.Clear("GetSystemConfigurations"); }
public void UpdateSystemConfiguration_updates_CouncilSpatialUri_reference_in_repository() { //arrange var sysconfig = new SystemConfigurationObject() { SettingId = 1 }; _repository.Add(sysconfig); var sysConfigToUpdate = new SystemConfigurationObject() { SettingId = 1, CouncilSpatialUri = "spatial" }; var mut = new SystemConfigurationService(_repository, _fakecacheprovider); //act var result = mut.UpdateSystemConfigurations(sysConfigToUpdate); //assert Assert.AreEqual("spatial", result.CouncilSpatialUri); //cleanup _repository.Delete(sysconfig); _fakecacheprovider.Clear("GetSystemConfigurations"); }
public void UpdateSystemConfiguration_updates_defaultzoom_reference_in_repository() { //arrange var sysconfig = new SystemConfigurationObject() { SettingId = 1 }; _repository.Add(sysconfig); var sysConfigToUpdate = new SystemConfigurationObject() { SettingId = 1, MapDefaultZoom = "12" }; var mut = new SystemConfigurationService(_repository, _fakecacheprovider); //act var result = mut.UpdateSystemConfigurations(sysConfigToUpdate); //assert Assert.AreEqual("12", result.MapDefaultZoom); //cleanup _repository.Delete(sysconfig); _fakecacheprovider.Clear("GetSystemConfigurations"); }
public void UpdateSystemConfiguration_updates_analytics_tracking_reference_in_repository() { //arrange var sysconfig = new SystemConfigurationObject() { SettingId = 1 }; _repository.Add(sysconfig); var sysConfigToUpdate = new SystemConfigurationObject() { SettingId = 1, AnalyticsTrackingRef = "analytics" }; var mut = new SystemConfigurationService(_repository, _fakecacheprovider); //act var result = mut.UpdateSystemConfigurations(sysConfigToUpdate); //assert Assert.AreEqual("analytics", result.AnalyticsTrackingRef); //cleanup _repository.Delete(sysconfig); _fakecacheprovider.Clear("GetSystemConfigurations"); }