Exemple #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]);
        }
        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);
        }
Exemple #3
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);
        }
        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);
        }
        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]);
        }
        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);
        }