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));
        }
示例#2
0
        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));
        }
示例#4
0
        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));
        }