public void TestEmpty()
 {
     ScriptFilesInjector inserter = new ScriptFilesInjector();
      Assert.AreEqual(0, inserter.CountKeys());
      string expected = CreateExpected();
      TestInjector(inserter, expected);
 }
        public void TestDuplicates()
        {
            ScriptFilesInjector inserter = new ScriptFilesInjector();
             string Url = "/Test.js";
             inserter.Add(new ScriptFileInjectorItem(Url));
             Assert.IsTrue(inserter.Contains(Url));
             inserter.Add(new ScriptFileInjectorItem(Url));   // should not add another as its a duplicate
             Assert.AreEqual(1, inserter.CountKeys());

             string expected = CreateExpected(Url);
             TestInjector(inserter, expected);
        }
        public void TestOrderedTwo()
        {
            ScriptFilesInjector inserter = new ScriptFilesInjector();
             string Url1 = "/Test1.js";
             string Url2 = "/Test2.js";
             Assert.IsFalse(inserter.Contains(Url1));
             Assert.IsFalse(inserter.Contains(Url2));
             inserter.Add(new ScriptFileInjectorItem(Url1), 10);
             Assert.IsTrue(inserter.Contains(Url1));
             Assert.IsFalse(inserter.Contains(Url2));
             inserter.Add(new ScriptFileInjectorItem(Url2), 0); // this will be shown before Url1
             Assert.IsTrue(inserter.Contains(Url1));
             Assert.IsTrue(inserter.Contains(Url2));
             Assert.AreEqual(2, inserter.CountKeys());

             string expected = CreateExpected(Url2, Url1);
             TestInjector(inserter, expected);
        }
        public void TestTwo()
        {
            ScriptFilesInjector inserter = new ScriptFilesInjector();
             string Url1 = "/Test1.js";
             string Url2 = "/Test2.js";
             Assert.IsFalse(inserter.Contains(Url1));
             Assert.IsFalse(inserter.Contains(Url2));
             inserter.Add(new ScriptFileInjectorItem(Url1));
             Assert.IsTrue(inserter.Contains(Url1));
             Assert.IsFalse(inserter.Contains(Url2));
             inserter.Add(new ScriptFileInjectorItem(Url2));
             Assert.IsTrue(inserter.Contains(Url1));
             Assert.IsTrue(inserter.Contains(Url2));
             Assert.AreEqual(2, inserter.CountKeys());

             string expected = CreateExpected(Url1, Url2);
             TestInjector(inserter, expected);
        }