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

             string expected = CreateExpected(Url);
             TestInjector(inserter, expected);
        }
        public void TestOrderedTwo()
        {
            StyleFilesInjector inserter = new StyleFilesInjector();
             string Url1 = "/Test1.css";
             string Url2 = "/Test2.css";
             Assert.IsFalse(inserter.Contains(Url1));
             Assert.IsFalse(inserter.Contains(Url2));
             inserter.Add(new StyleFileInjectorItem(Url1), 10);
             Assert.IsTrue(inserter.Contains(Url1));
             Assert.IsFalse(inserter.Contains(Url2));
             inserter.Add(new StyleFileInjectorItem(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()
        {
            StyleFilesInjector inserter = new StyleFilesInjector();
             string Url1 = "/Test1.css";
             string Url2 = "/Test2.css";
             Assert.IsFalse(inserter.Contains(Url1));
             Assert.IsFalse(inserter.Contains(Url2));
             inserter.Add(new StyleFileInjectorItem(Url1));
             Assert.IsTrue(inserter.Contains(Url1));
             Assert.IsFalse(inserter.Contains(Url2));
             inserter.Add(new StyleFileInjectorItem(Url2));
             Assert.IsTrue(inserter.Contains(Url1));
             Assert.IsTrue(inserter.Contains(Url2));
             Assert.AreEqual(2, inserter.CountKeys());

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