コード例 #1
0
        public void ValueProviderProcessor_Stops_If_RequestedType_Is_Not_Equal_To_SupportedType()
        {
            //Arrange
            var processor = new MockValueProviderProcessor <RenderingParameters>(new RenderingParameters(string.Empty));
            var args      = new ValueProviderArgs(typeof(Item));

            //Act
            processor.Process(args);

            //Assert
            Assert.IsNull(args.Result);
        }
コード例 #2
0
        public void ValueProviderProcessor_Aborts_The_Pipeline_If_Result_Is_Retrieved()
        {
            //Arrange
            var result    = new RenderingParameters("?c=d");
            var processor = new MockValueProviderProcessor <RenderingParameters>(result);
            var args      = new ValueProviderArgs(typeof(RenderingParameters));

            //Act
            processor.Process(args);

            //Assert
            Assert.IsTrue(args.Aborted);
        }
コード例 #3
0
        public void ValueProviderProcessor_Sets_The_ArgsResults_When_Retrieved()
        {
            //Arrange
            var expectedResult = new RenderingParameters("?c=d");
            var processor      = new MockValueProviderProcessor <RenderingParameters>(expectedResult);
            var args           = new ValueProviderArgs(typeof(RenderingParameters));

            //Act
            processor.Process(args);

            //Assert
            Assert.AreSame(expectedResult, args.Result);
        }
コード例 #4
0
        public void ValueProviderProcessor_Stops_If_There_Already_Is_A_Result()
        {
            //Arrange
            var expectedResult = new RenderingParameters("?a=b");
            var processor      = new MockValueProviderProcessor <RenderingParameters>(new RenderingParameters("?c=d"));
            var args           = new ValueProviderArgs(typeof(RenderingParameters))
            {
                Result = expectedResult
            };

            //Act
            processor.Process(args);

            //Assert
            Assert.AreSame(expectedResult, args.Result);
        }