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

            Assert.ThrowsException <InvalidOperationException>(() =>
                                                               microwaveUiConfigureOptions.PostConfigure("hm", new StaticFileOptions()));
        }
Beispiel #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());
        }