Created
April 14, 2011 23:44
-
-
Save emiaj/920843 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.IO; | |
| using System.Linq; | |
| using FubuMVC.Spark.Tokenization; | |
| using FubuMVC.Spark.Tokenization.Model; | |
| using FubuMVC.Spark.Tokenization.Parsing; | |
| using NUnit.Framework; | |
| using Rhino.Mocks; | |
| namespace FubuMVC.Spark.Tests.Tokenization | |
| { | |
| public class MasterPageEnricherTester | |
| { | |
| private MasterPageEnricher _enricher; | |
| private EnrichmentContext _context; | |
| private SparkFiles _sparkFiles; | |
| [TestFixtureSetUp] | |
| public void Setup() | |
| { | |
| var baseDirectory = AppDomain.CurrentDomain.BaseDirectory; | |
| var root = Path.Combine(baseDirectory, "inetput", "www", "web"); | |
| _context = new EnrichmentContext(); | |
| var parser = MockRepository.GenerateMock<ISparkParser>(); | |
| parser.Stub(x => x.Parse(_context.FileContent, "use", "master")).Return("application"); | |
| _enricher = new MasterPageEnricher(parser); | |
| _sparkFiles = new SparkFiles | |
| { | |
| new SparkFile(Path.Combine(root, "Controllers", "Home", "Home.spark"), root,"Root"), | |
| new SparkFile(Path.Combine(root, "Handlers", "Products", "list.spark"),root, "Root"), | |
| new SparkFile(Path.Combine(root, "Actions", "Shared", "application.spark"),root, "Root"), | |
| new SparkFile(Path.Combine(root, "Handlers", "Shared", "application.spark"),root, "Root"), | |
| new SparkFile(Path.Combine(root, "Controllers", "Shared", "application.spark"),root, "Root"), | |
| new SparkFile(Path.Combine(root, "Shared", "application.spark"),root, "Root"), | |
| new SparkFile(Path.Combine(root, "Handlers", "Products", "details.spark"),root, "Root"), | |
| }; | |
| _context.SparkFiles = _sparkFiles; | |
| } | |
| [Test] | |
| [Ignore("Work in progress")] | |
| public void master_is_the_nearest_file_with_the_same_name_in_shared() | |
| { | |
| var sparkFile = _sparkFiles.First(); | |
| _enricher.Enrich(sparkFile, _context); | |
| Assert.AreEqual(_sparkFiles.ElementAt(4), sparkFile.Master); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment