public void MultipleInclude_shouldChooseTheHighestPosition_WithoutDefault() { string expectedHead = "<!-- WebDependencies/Head - start -->\r\n" + "<link href=\"//css1.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n" + "<!-- WebDependencies/Head - end -->\r\n"; string expectedEndOfPage = "<!-- WebDependencies/EndOfPage - start -->\r\n" + "<!-- WebDependencies/EndOfPage - end -->\r\n"; var item1 = new WebDependency("test1"); item1.Add(new WebDependencyFile("//css1.css", WebDependencyFileType.Css)); var target = new WebDependencies(); target.Include(item1, WebDependencyPosition.EndOfPage); target.Include(item1, WebDependencyPosition.Head); var result = target.RenderIncludes(WebDependencyPosition.Head); SrkToolkit.Testing.Assert.AreEqual(expectedHead, result.ToString()); result = target.RenderIncludes(WebDependencyPosition.EndOfPage); SrkToolkit.Testing.Assert.AreEqual(expectedEndOfPage, result.ToString()); }
public void AppliesOrder_Ordered_Order2() { string expected = "<!-- WebDependencies/Default - start -->\r\n" + "<link href=\"//css1.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n" + "<link href=\"//css2.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n" + "<!-- WebDependencies/Default - end -->\r\n"; var item1 = new WebDependency("test1"); item1.Order = 1; item1.Add(new WebDependencyFile("//css1.css", WebDependencyFileType.Css)); var item2 = new WebDependency("test2"); item2.Order = 2; item2.Add(new WebDependencyFile("//css2.css", WebDependencyFileType.Css)); var target = new WebDependencies(); target.Include(item2); target.Include(item1); var result = target.RenderIncludes(WebDependencyPosition.Default); SrkToolkit.Testing.Assert.AreEqual(expected, result.ToString()); }