mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-17 01:33:03 +08:00
# Conflicts: # Build/MQTTnet.nuspec # Source/MQTTnet/Server/Internal/MqttClientSessionsManager.cs
24 lines
686 B
C#
24 lines
686 B
C#
using System.Linq;
|
|
using System.Text;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using MQTTnet.Client;
|
|
using MQTTnet.Extensions;
|
|
|
|
namespace MQTTnet.Tests.Client
|
|
{
|
|
[TestClass]
|
|
public class MqttClientOptionsBuilder_Tests
|
|
{
|
|
[TestMethod]
|
|
public void WithConnectionUri_Credential_Test()
|
|
{
|
|
var options = new MqttClientOptionsBuilder()
|
|
.WithConnectionUri("mqtt://user:password@127.0.0.1")
|
|
.Build();
|
|
|
|
Assert.AreEqual("user", options.Credentials.Username);
|
|
Assert.IsTrue(Encoding.UTF8.GetBytes("password").SequenceEqual(options.Credentials.Password));
|
|
}
|
|
}
|
|
}
|