Exemple #1
0
        public void AddKvpTest()
        {
            // Arrange
            var dict = new InsertOrderedDictionary <int, string>
            {
                { 2, "3" },
                { 3, "4" },
                { 4, "5" },
                // {5, "1"},
                // {1, "2"}
            };

            // Act
            dict.Add(new KeyValuePair <int, string>(5, "1"));
            dict.Add(new KeyValuePair <int, string>(1, "2"));

            // Assert
            var expectedKvp = new[]
            {
                new KeyValuePair <int, string>(2, "3"),
                new KeyValuePair <int, string>(3, "4"),
                new KeyValuePair <int, string>(4, "5"),
                new KeyValuePair <int, string>(5, "1"),
                new KeyValuePair <int, string>(1, "2")
            };

            CollectionAssert.AreEqual(expectedKvp, dict);
        }
		public void AddKvpTest()
		{
			// Arrange
			var dict = new InsertOrderedDictionary<int, string>
			{
				{2, "3"},
				{3, "4"},
				{4, "5"},
				// {5, "1"},
				// {1, "2"}
			};

			// Act
			dict.Add(new KeyValuePair<int, string>(5, "1"));
			dict.Add(new KeyValuePair<int, string>(1, "2"));

			// Assert
			var expectedKvp = new[]
			{
				new KeyValuePair<int, string>(2, "3"),
				new KeyValuePair<int, string>(3, "4"),
				new KeyValuePair<int, string>(4, "5"),
				new KeyValuePair<int, string>(5, "1"),
				new KeyValuePair<int, string>(1, "2")
			};

			CollectionAssert.AreEqual(expectedKvp, dict);
		}
        private static void CheckResources(BaseControl control, InsertOrderedDictionary<string, string> scripts, InsertOrderedDictionary<string, string> styles)
        {            
            foreach (ClientScriptItem item in control.GetScripts())
            {
                string resourcePath = GlobalConfig.Settings.ScriptMode == ScriptMode.Debug && item.PathEmbeddedDebug.IsNotEmpty() ? item.PathEmbeddedDebug : item.PathEmbedded;

                if (!scripts.ContainsKey(resourcePath))
                {
                    scripts.Add(resourcePath, ExtNetTransformer.GetWebResourceUrl(item.Type, resourcePath));
                }
            }

            foreach (ClientStyleItem item in control.GetStyles())
            {
                if (!styles.ContainsKey(item.PathEmbedded) && item.Theme.Equals(Theme.Default))
                {
                    styles.Add(item.PathEmbedded, ExtNetTransformer.GetWebResourceUrl(item.Type, item.PathEmbedded));
                }
            }
        }