示例#1
0
        public void DiscoveryOptionThrowsException()
        {
            var mock = new Mock <IWebHostEnvironment>();
            var microwaveUiConfigureOptions = new MicrowaveUiConfigureOptions(mock.Object);

            Assert.ThrowsException <InvalidOperationException>(() =>
                                                               microwaveUiConfigureOptions.PostConfigure("hm", new StaticFileOptions()));
        }
示例#2
0
        public void DiscoveryOption()
        {
            var mock         = new Mock <IWebHostEnvironment>();
            var fileProvider = new EmbeddedFileProvider(typeof(RestOfPagesTests).Assembly);

            mock.Setup(m => m.ContentRootFileProvider).Returns(fileProvider);
            var microwaveUiConfigureOptions = new MicrowaveUiConfigureOptions(mock.Object);

            var staticFileOptions = new StaticFileOptions();

            microwaveUiConfigureOptions.PostConfigure("hm", staticFileOptions);

            Assert.AreEqual(typeof(CompositeFileProvider), staticFileOptions.FileProvider.GetType());
        }