public Create ( object parent, object configContext, |
||
parent | object | 부모 개체입니다. |
configContext | object | 구성 컨텍스트 개체입니다. |
section | 섹션 XML 노드입니다. | |
리턴 | object |
public void Parse_From_Null_Section() { var handler = new MongoCacheSectionHandler(); var section = new XmlDocument(); var result = handler.Create(null, null, section); Assert.IsNotNull(result); Assert.IsTrue(result is MongoCacheConfig[]); var cacheConfigs = result as MongoCacheConfig[]; Assert.AreEqual(0, cacheConfigs.Length); }
public void Parse_From_Config_Section() { const string xmlText = @"<mongoCache><cache region='NFramework' connectionString='server=localhost;database=NHCaches;safe=true;' expiration='00:00:05' compressThreshold='1024' /></mongoCache>"; var handler = new MongoCacheSectionHandler(); var section = GetConfigurationSection(xmlText); var cache = CreateCache(handler.Create(null, null, section) as MongoCacheConfig[]); Assert.AreEqual("NSoft.NFramework", cache[0].Region); Assert.AreEqual(5, cache[0].Expiry.TotalSeconds); Assert.AreEqual(1024, cache[0].CompressThreshold); }
public void Parse_From_Config_Section() { const string xmlText = @"<mongoCache><cache region='NFramework' connectionString='server=localhost;database=NHCaches;safe=true;' expiration='00:00:05' compressThreshold='1024' /></mongoCache>"; var handler = new MongoCacheSectionHandler(); var section = GetConfigurationSection(xmlText); var cache = CreateCache(handler.Create(null, null, section) as MongoCacheConfig[]); Assert.AreEqual("NSoft.NFramework", cache[0].Region); Assert.AreEqual(5, cache[0].Expiry.TotalSeconds); Assert.AreEqual(1024, cache[0].CompressThreshold); }
public void Parse_From_Null_Section() { var handler = new MongoCacheSectionHandler(); var section = new XmlDocument(); var result = handler.Create(null, null, section); Assert.IsNotNull(result); Assert.IsTrue(result is MongoCacheConfig[]); var cacheConfigs = result as MongoCacheConfig[]; Assert.AreEqual(0, cacheConfigs.Length); }