Inheritance: IStyleProxy
Exemple #1
0
            public void TestFixtureSetup()
            {
                const string path = "simple.css";

                _proxy = new StyleProxy ();
                _proxy.LoadFromFile (path);
            }
Exemple #2
0
            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());
            }
Exemple #3
0
            public void Normal_File()
            {
                const string path = "simple.css";

                Assert.IsTrue (File.Exists(path));

                var proxy = new StyleProxy ();

                proxy.LoadFromFile (path);

                Assert.IsTrue(proxy.Stylesheet.RuleSets.Any (s1 => s1.Selectors.Any(s => s.SimpleSelectors.Any(ss => ss.ID == "firstId"))));
            }
Exemple #4
0
            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"))));
            }
Exemple #5
0
            public void Non_Existent_File()
            {
                const string path = "non_existent_file.css";

                Assert.IsFalse (File.Exists (path));

                var proxy = new StyleProxy ();

                Assert.Throws(typeof(FileNotFoundException), () => proxy.LoadFromFile(path));
            }