Skip to content

Commit 0dbd8e2

Browse files
committed
Update new test method
1 parent d3a2610 commit 0dbd8e2

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

test/WebJobs.Script.Tests/ScriptStartupTypeDiscovererTests.cs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,12 +504,16 @@ public async Task GetExtensionsStartupTypes_BundlesNotConfiguredBindingsConfigur
504504
[Fact]
505505
public async Task GetExtensionsStartupTypes_NoBindings_In_ExtensionJson()
506506
{
507-
ExtensionInstall blobs = new("AzureStorageBlobs", typeof(AzureStorageWebJobsStartup));
508-
string binPath = InstallExtensions(ExtensionInstall.Storage(true), blobs);
507+
ExtensionInstall storage1 = new("AzureStorageBlobs", typeof(AzureStorageWebJobsStartup));
508+
ExtensionInstall storage2 = new("Storage", typeof(AzureStorageWebJobsStartup))
509+
{
510+
HintPath = "Microsoft.Azure.WebJobs.Extensions.Storage.dll"
511+
};
509512

513+
string binPath = InstallExtensions(storage1, storage2);
510514
_bundleManager.Setup(e => e.IsExtensionBundleConfigured()).Returns(true);
511-
_bundleManager.Setup(e => e.GetExtensionBundleDetails()).Returns(Task.FromResult(new ExtensionBundleDetails() { Id = "bundleID", Version = "1.0.0" }));
512-
_bundleManager.Setup(e => e.GetExtensionBundleBinPathAsync()).Returns(Task.FromResult(binPath));
515+
_bundleManager.Setup(e => e.GetExtensionBundleDetails()).ReturnsAsync(new ExtensionBundleDetails() { Id = "bundleID", Version = "1.0.0" });
516+
_bundleManager.Setup(e => e.GetExtensionBundleBinPathAsync()).ReturnsAsync(binPath);
513517

514518
// Act
515519
ScriptStartupTypeLocator discoverer = CreateSystemUnderTest();
@@ -697,6 +701,8 @@ private bool AreExpectedMetricsGenerated()
697701

698702
private class ExtensionInstall(string name, Type startupType, params string[] bindings)
699703
{
704+
public string HintPath { get; init; }
705+
700706
public static ExtensionInstall Storage(bool includeBinding = false)
701707
{
702708
string[] bindings = includeBinding ? ["blob"] : [];
@@ -721,7 +727,12 @@ public static ExtensionInstall Http()
721727

722728
public ExtensionReference GetReference()
723729
{
724-
ExtensionReference reference = new() { Name = name, TypeName = startupType.AssemblyQualifiedName };
730+
ExtensionReference reference = new()
731+
{
732+
Name = name,
733+
TypeName = startupType.AssemblyQualifiedName,
734+
HintPath = HintPath,
735+
};
725736
foreach (string binding in bindings ?? Enumerable.Empty<string>())
726737
{
727738
reference.Bindings.Add(binding);

0 commit comments

Comments
 (0)