public LoadFromStream ( Stream stream ) : void | ||
stream | Stream | |
Résultat | void |
public void With_Corrupt_Stream() { const string content = "}}color: #FFFFFF;{{"; var proxy = new StyleProxy(); using (var stream = new MemoryStream(UTF8Encoding.Default.GetBytes(content))) { proxy.LoadFromStream(stream); } Assert.IsFalse(proxy.Stylesheet.RuleSets.Any()); }
public void Normal_Stream() { const string path = "simple.css"; Assert.IsTrue (File.Exists(path)); var proxy = new StyleProxy (); using (var stream = new FileStream(path, FileMode.Open)) { proxy.LoadFromStream(stream); } Assert.IsTrue(proxy.Stylesheet.RuleSets.Any (s1 => s1.Selectors.Any(s => s.SimpleSelectors.Any(ss => ss.ID == "firstId")))); }