示例#1
0
        public void ExpandViewLocations_NoDevice_ReturnsExpected()
        {
            var context       = SetupViewLocationExpanderContext();
            var viewLocations = new List <string>()
            {
                "/Views/{1}/{0}.cshtml", "/Views/Shared/{0}.cshtml"
            };
            var locationExpander = new ResponsiveViewLocationExpander();
            var resultLocations  = locationExpander.ExpandViewLocations(context, viewLocations);

            Assert.Equal(viewLocations, resultLocations);
        }
示例#2
0
        public void ExpandViewLocations_ViewLocationExpanderContext_IEnumerable_ReturnsExpected(
            ResponsiveViewLocationFormat format,
            IEnumerable <string> viewLocations,
            IEnumerable <string> expectedViewLocations)
        {
            var context          = SetupViewLocationExpanderContext();
            var locationExpander = new ResponsiveViewLocationExpander(format);

            locationExpander.PopulateValues(context);
            var resultLocations = locationExpander.ExpandViewLocations(context, viewLocations).ToList();

            Assert.Equal(expectedViewLocations, resultLocations.ToList());
        }
示例#3
0
        public void ExpandViewLocations_ViewLocationExpanderContext_IEnumerable_ReturnsExpected()
        {
            var context       = SetupViewLocationExpanderContext();
            var viewLocations = new List <string>()
            {
                "{0} location1", "{0} location2"
            };
            var locationExpander = new ResponsiveViewLocationExpander();

            locationExpander.PopulateValues(context);
            var resultLocations = locationExpander.ExpandViewLocations(context, viewLocations);

            Assert.True(viewLocations.Count < resultLocations.ToList().Count);
        }
示例#4
0
        public void ExpandViewLocations_ViewLocationExpanderContext_Null_ThrowsArgumentNullException()
        {
            var locationExpander = new ResponsiveViewLocationExpander();

            Assert.Throws <ArgumentNullException>(() => locationExpander.ExpandViewLocations(SetupViewLocationExpanderContext(), null));
        }
示例#5
0
        public void ExpandViewLocations_Null_IEnumerable_ThrowsArgumentNullException()
        {
            var locationExpander = new ResponsiveViewLocationExpander();

            Assert.Throws <ArgumentNullException>(() => locationExpander.ExpandViewLocations(null, new List <string>()));
        }