Skip to content

Commit

Permalink
Update version to 0.0.2-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Kees Schollaart committed Apr 1, 2018
1 parent 18df005 commit f3c5e53
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RepositoryUrl>https://github.com/keesschollaart81/CaseOnline.Azure.WebJobs.Extensions.Mqtt</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseUrl>https://github.com/keesschollaart81/CaseOnline.Azure.WebJobs.Extensions.Mqtt/blob/master/LICENSE</PackageLicenseUrl>
<VersionPrefix>0.0.1</VersionPrefix>
<VersionPrefix>0.0.2</VersionPrefix>
<VersionSuffix>beta</VersionSuffix>
<PackageTags>azure functions mqtt webjobs trigger binding function webjob</PackageTags>
<AssemblyName>CaseOnline.Azure.WebJobs.Extensions.Mqtt</AssemblyName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,29 @@ public static void Testert([MqttTrigger("test/topic")] PublishedMqttMessage publ
}

[Fact]
public async Task CustomConnectionStringIsReceived()
public async Task CustomConnectionWithClientIdIsReceived()
{
using (var mqttServer = await MqttServerHelper.Get(_logger))
using (var jobHost = await JobHostHelper.RunFor<CustomConnectionStringTestFunction>(_loggerFactory))
string clientId = string.Empty;
var options = new MqttServerOptionsBuilder()
.WithConnectionValidator(x =>
{
clientId = x.ClientId;
})
.Build();

using (var mqttServer = await MqttServerHelper.Get(_logger, options))
using (var jobHost = await JobHostHelper.RunFor<CustomConnectionStringWithClientIdTestFunction>(_loggerFactory))
{
await mqttServer.PublishAsync(DefaultMessage);

await jobHost.WaitFor(() => CustomConnectionStringTestFunction.CallCount >= 1);
await jobHost.WaitFor(() => CustomConnectionStringWithClientIdTestFunction.CallCount >= 1);
}

Assert.Equal(1, CustomConnectionStringTestFunction.CallCount);
Assert.Equal(1, CustomConnectionStringWithClientIdTestFunction.CallCount);
Assert.Equal("Custom", clientId);
}

private class CustomConnectionStringTestFunction
private class CustomConnectionStringWithClientIdTestFunction
{
public static int CallCount = 0;
public static PublishedMqttMessage LastReceivedMessage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true",
"MqttConnection": "Server=localhost",
"CustomMqttConnection": "Server=localhost",
"CustomMqttConnection": "Server=localhost;ClientId=Custom",
"MqttConnectionWithCustomPort": "Server=localhost;Port=1337",
"MqttConnectionWithUsernameAndPassword": "Server=localhost;Username=admin;Password=Welkom123"
}

0 comments on commit f3c5e53

Please sign in to comment.