public void TestMergerReturnsDefaultSourceForNilInput() { var defaultConfig = new SessionConfigPOD(); defaultConfig.InstanceUrl = "sitecore.net"; defaultConfig.ItemWebApiVersion = "v1"; defaultConfig.Site = "/sitecore/shell"; var merger = new SessionConfigMerger(defaultConfig); ISessionConfig result = merger.FillSessionConfigGaps(null); Assert.AreSame(defaultConfig, result); }
public void TestUserFieldsHaveHigherPriority() { var defaultConfig = new SessionConfigPOD(); defaultConfig.InstanceUrl = "sitecore.net"; defaultConfig.ItemWebApiVersion = "v1"; defaultConfig.Site = "/sitecore/shell"; var userConfig = new SessionConfigPOD(); userConfig.InstanceUrl = "http://localhost:80"; userConfig.ItemWebApiVersion = "v100500"; userConfig.Site = "/abra/kadabra"; var merger = new SessionConfigMerger(defaultConfig); ISessionConfig result = merger.FillSessionConfigGaps(userConfig); Assert.AreEqual(userConfig, result); Assert.AreNotSame(userConfig, result); }
public void TestNullUserFieldsAreAutocompleted() { var defaultConfig = new SessionConfigPOD(); defaultConfig.InstanceUrl = "sitecore.net"; defaultConfig.ItemWebApiVersion = "v1"; defaultConfig.Site = "/sitecore/shell"; var userConfig = new SessionConfigPOD(); userConfig.InstanceUrl = null; userConfig.ItemWebApiVersion = null; userConfig.Site = null; var merger = new SessionConfigMerger(defaultConfig); ISessionConfig result = merger.FillSessionConfigGaps(userConfig); Assert.AreEqual(defaultConfig, result); Assert.AreNotSame(defaultConfig, result); }