Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ExtensionsSample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.IO;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Azure;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -54,6 +55,7 @@ public static async Task Main(string[] args)
.ConfigureServices(s =>
{
s.AddSingleton<ITypeLocator>(typeLocator);
s.AddAzureClientsCore();
})
.UseConsoleLifetime();

Expand Down
1 change: 0 additions & 1 deletion src/WebJobs.Extensions.CosmosDB/CosmosDBAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public CosmosDBAttribute(string databaseName, string containerName)
/// <summary>
/// Gets or sets the connection string for the service containing the container to monitor.
/// </summary>
[ConnectionString]
public string Connection { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public CosmosDBTriggerAttribute(string databaseName, string containerName)
/// <summary>
/// Gets or sets the connection string for the service containing the container to monitor.
/// </summary>
[ConnectionString]
public string Connection { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public async Task TriggerObject()

var factoryMock = new Mock<ICosmosDBServiceFactory>(MockBehavior.Strict);
factoryMock
.Setup(f => f.CreateService(AttributeConnStr, It.IsAny<CosmosClientOptions>()))
.Setup(f => f.CreateService("MyConnectionString", It.IsAny<CosmosClientOptions>()))
.Returns(serviceMock.Object);

var jobject = JObject.FromObject(new QueueData { DocumentId = "docid1", PartitionKey = "partkey1" });
Expand All @@ -319,7 +319,7 @@ public async Task TriggerObject()
await RunTestAsync(nameof(CosmosDBEndToEndFunctions.TriggerObject), factoryMock.Object, jobject.ToString());

// Assert
factoryMock.Verify(f => f.CreateService(AttributeConnStr, It.IsAny<CosmosClientOptions>()), Times.Once());
factoryMock.Verify(f => f.CreateService("MyConnectionString", It.IsAny<CosmosClientOptions>()), Times.Once());
Assert.Equal("TriggerObject", _loggerProvider.GetAllUserLogMessages().Single().FormattedMessage);
}

Expand Down