public async void GetBindings_BundleNotConfigured_ReturnsNull() { var contentProvider = new ExtensionBundleContentProvider(new TestExtensionBundleManager(isExtensionBundleConfigured: false), NullLogger <ExtensionBundleContentProvider> .Instance); var bindings = await contentProvider.GetBindings(); Assert.Null(bindings); }
public async void GetBindings_BundleConfigured_ReturnsBindings() { var contentProvider = new ExtensionBundleContentProvider(new TestExtensionBundleManager(bundlePath: "bundlePath", isExtensionBundleConfigured: true), NullLogger <ExtensionBundleContentProvider> .Instance); var fileSystemTuple = CreateFileSystem(); var fileBase = fileSystemTuple.Item3; var path = Path.Combine("bundlePath", "StaticContent", "v1", "bindings", "bindings.json"); fileBase.Setup(f => f.Exists(path)).Returns(true); fileBase.Setup(f => f.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete)).Returns(GetReadableStream()); FileUtility.Instance = fileSystemTuple.Item1.Object; var bindings = await contentProvider.GetBindings(); Assert.NotNull(bindings); Assert.Equal(bindings, StreamContent); }