Ejemplo n.º 1
0
        public void DataTest()
        {
            CacheStorageData cacheStorage = new CustomCacheStorageData();

            cacheStorage.Name = "testCacheStorage";

            CacheManagerDataCollection cacheManagers = new CacheManagerDataCollection();
            CacheManagerData           testManager1  = new CacheManagerData();

            testManager1.Name         = "testName";
            testManager1.CacheStorage = cacheStorage;
            cacheManagers.Add(testManager1);

            CacheManagerSettings data = new CacheManagerSettings();

            data.CacheManagers.Clear();
            data.CacheManagers.AddRange(cacheManagers);

            CacheManagerSettingsNode node = new CacheManagerSettingsNode(data);

            applicationNode.Nodes.Add(node);
            CacheManagerSettings nodeData = node.CacheManagerSettings;

            Assert.AreSame(testManager1, nodeData.CacheManagers[testManager1.Name]);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CacheManagerDataCollection"/> class with the given settings.
 /// </summary>
 /// <param name="cacheManagerDataCollection">A settings class to use for initialization.</param>
 public CacheManagerCollectionNode(CacheManagerDataCollection cacheManagerDataCollection) : base()
 {
     if (cacheManagerDataCollection == null)
     {
         throw new ArgumentNullException("cacheManagerDataCollection");
     }
     this.cacheManagerDataCollection = cacheManagerDataCollection;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CacheManagerDataCollection"/> class with the given settings.
 /// </summary>
 /// <param name="cacheManagerDataCollection">A settings class to use for initialization.</param>
 public CacheManagerCollectionNode(CacheManagerDataCollection cacheManagerDataCollection)
     : base()
 {
     if (cacheManagerDataCollection == null)
     {
         throw new ArgumentNullException("cacheManagerDataCollection");
     }
     this.cacheManagerDataCollection = cacheManagerDataCollection;
 }
Ejemplo n.º 4
0
        public void NodeTest()
        {
            CacheManagerCollectionNode node = new CacheManagerCollectionNode();

            applicationNode.Nodes.Add(node);
            Assert.AreEqual(SR.DefaultCacheManagerCollectionNodeName, node.Name);

            CacheManagerNode cacheManagerNode = new CacheManagerNode();

            node.Nodes.Add(cacheManagerNode);
            cacheManagerNode.Name = "tesotvetyevt";

            CacheManagerDataCollection managers = node.CacheManagerDataCollection;

            Assert.IsNotNull(managers[cacheManagerNode.Name]);
        }
Ejemplo n.º 5
0
        public void DataTest()
        {
            CacheStorageData cacheStorage = new CustomCacheStorageData();
            cacheStorage.Name = "testevtu8entv";
            CacheManagerDataCollection data = new CacheManagerDataCollection();
            CacheManagerData cacheManagerData = new CacheManagerData();
            cacheManagerData.CacheStorage = cacheStorage;
            cacheManagerData.Name = "tesotvetyevt";

            data.Add(cacheManagerData);

            CacheManagerCollectionNode node = new CacheManagerCollectionNode(data);
            applicationNode.Nodes.Add(node);
            CacheManagerDataCollection nodeData = node.CacheManagerDataCollection;

            Assert.AreEqual(data.Count, nodeData.Count);
            Assert.AreEqual(data[cacheManagerData.Name].CacheStorage.Name, nodeData[cacheManagerData.Name].CacheStorage.Name);
        }
Ejemplo n.º 6
0
        public void CopyToTest()
        {
            CacheManagerDataCollection collection = new CacheManagerDataCollection();

            CacheManagerData data = new CacheManagerData();
            data.Name = "Cache1";
            CacheManagerData data1 = new CacheManagerData();
            data1.Name = "Cache2";

            collection.Add(data);
            collection.Add(data1);

            CacheManagerData[] array = new CacheManagerData[collection.Count];

            collection.CopyTo(array, 0);

            Assert.AreSame(array[0], data);
            Assert.AreSame(array[1], data1);
        }
Ejemplo n.º 7
0
        public void DataTest()
        {
            CacheStorageData cacheStorage = new CustomCacheStorageData();
            cacheStorage.Name = "testCacheStorage";

            CacheManagerDataCollection cacheManagers = new CacheManagerDataCollection();
            CacheManagerData testManager1 = new CacheManagerData();
            testManager1.Name = "testName";
            testManager1.CacheStorage = cacheStorage;
            cacheManagers.Add(testManager1);

            CacheManagerSettings data = new CacheManagerSettings();
            data.CacheManagers.Clear();
            data.CacheManagers.AddRange(cacheManagers);

            CacheManagerSettingsNode node = new CacheManagerSettingsNode(data);
            applicationNode.Nodes.Add(node);
            CacheManagerSettings nodeData = node.CacheManagerSettings;

            Assert.AreSame(testManager1, nodeData.CacheManagers[testManager1.Name]);
        }
Ejemplo n.º 8
0
        public void CopyToTest()
        {
            CacheManagerDataCollection collection = new CacheManagerDataCollection();

            CacheManagerData data = new CacheManagerData();

            data.Name = "Cache1";
            CacheManagerData data1 = new CacheManagerData();

            data1.Name = "Cache2";

            collection.Add(data);
            collection.Add(data1);

            CacheManagerData[] array = new CacheManagerData[collection.Count];

            collection.CopyTo(array, 0);

            Assert.AreSame(array[0], data);
            Assert.AreSame(array[1], data1);
        }
Ejemplo n.º 9
0
        public void DataTest()
        {
            CacheStorageData cacheStorage = new CustomCacheStorageData();

            cacheStorage.Name = "testevtu8entv";
            CacheManagerDataCollection data             = new CacheManagerDataCollection();
            CacheManagerData           cacheManagerData = new CacheManagerData();

            cacheManagerData.CacheStorage = cacheStorage;
            cacheManagerData.Name         = "tesotvetyevt";

            data.Add(cacheManagerData);

            CacheManagerCollectionNode node = new CacheManagerCollectionNode(data);

            applicationNode.Nodes.Add(node);
            CacheManagerDataCollection nodeData = node.CacheManagerDataCollection;

            Assert.AreEqual(data.Count, nodeData.Count);
            Assert.AreEqual(data[cacheManagerData.Name].CacheStorage.Name, nodeData[cacheManagerData.Name].CacheStorage.Name);
        }