Example #1
0
        public void TestRobotsTxtContent()
        {
            _blogConfigMock.Setup(bc => bc.AdvancedSettings).Returns(new Configuration.AdvancedSettings
            {
                RobotsTxtContent = "996"
            });

            var ctl    = new AssetsController(_loggerMock.Object, _appSettingsMock.Object, _blogConfigMock.Object);
            var result = ctl.RobotsTxt();

            Assert.IsInstanceOf(typeof(ContentResult), result);
        }
Example #2
0
        public void TestRobotsTxtEmpty()
        {
            _blogConfigMock.Setup(bc => bc.AdvancedSettings).Returns(new Configuration.AdvancedSettings
            {
                RobotsTxtContent = string.Empty
            });

            var ctl = new AssetsController(
                _loggerMock.Object,
                _appSettingsMock.Object,
                _imageStorageSettingsMock.Object,
                _asyncImageStorageProviderMock.Object,
                _blogConfigMock.Object,
                _siteIconGeneratorMock.Object);

            var result = ctl.RobotsTxt();

            Assert.IsInstanceOf(typeof(NotFoundResult), result);
        }