public void UsesTheSparkEngineToCreateAView() { var expectedSparkView = new TestSparkResourceView(); var sparkViewEngine = MockRepository.GenerateStub<ISparkViewEngine>() .StubCreateInstance(expectedSparkView); sparkViewEngine.StubCreateInstance(expectedSparkView); var resolver = new SparkViewResolverBuilder().With(sparkViewEngine).Build(); ISparkView resolvedView = resolver.Create(null, null); Assert.That(resolvedView, Is.EqualTo(expectedSparkView)); }
public void UsesTheSparkEngineToCreateAView() { var expectedSparkView = new TestSparkResourceView(); var sparkViewEngine = MockRepository.GenerateStub <ISparkViewEngine>() .StubCreateInstance(expectedSparkView); sparkViewEngine.StubCreateInstance(expectedSparkView); var resolver = new SparkViewResolverBuilder().With(sparkViewEngine).Build(); ISparkView resolvedView = resolver.Create(null, null); Assert.That(resolvedView, Is.EqualTo(expectedSparkView)); }
public void EnhancesTheViewWithTheViewData() { var expectedSparkView = new TestSparkResourceView(); var sparkViewEngine = MockRepository.GenerateStub<ISparkViewEngine>() .StubCreateInstance(expectedSparkView); sparkViewEngine.StubCreateInstance(expectedSparkView); var resolver = new SparkViewResolverBuilder().With(sparkViewEngine).Build(); object viewData = new object(); SparkResourceView resolvedView = (SparkResourceView) resolver.Create(null, viewData); Assert.That(resolvedView.ViewData, Is.Not.Null); Assert.That(resolvedView.ViewData.Eval("Resource"), Is.EqualTo(viewData)); }
public void EnhancesTheViewWithTheViewData() { var expectedSparkView = new TestSparkResourceView(); var sparkViewEngine = MockRepository.GenerateStub <ISparkViewEngine>() .StubCreateInstance(expectedSparkView); sparkViewEngine.StubCreateInstance(expectedSparkView); var resolver = new SparkViewResolverBuilder().With(sparkViewEngine).Build(); object viewData = new object(); SparkResourceView resolvedView = (SparkResourceView)resolver.Create(null, viewData); Assert.That(resolvedView.ViewData, Is.Not.Null); Assert.That(resolvedView.ViewData.Eval("Resource"), Is.EqualTo(viewData)); }