Skip to content

Commit

Permalink
fixed some failing specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Apr 13, 2024
1 parent e21b848 commit 5121d7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class ConnectFlagsSpecs
public class when_creating_connect_flags
{
[Fact]
public void it_should_have_clean_session_flag_set_to_true_by_default()
public void it_should_have_clean_session_flag_set_to_false_by_default()
{
var flags = new ConnectFlags();
flags.CleanSession.Should().BeTrue();
flags.CleanSession.Should().BeFalse();
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,6 @@ [Fact] public void should_have_correct_payload()
}
}

// create a test case for working with username and password
public class WhenCreatingUsernameAndPassword
{
[Fact] public void should_have_correct_username_password()
{
var password = new byte[] { 1, 2, 3 };
var connectPacket = new ConnectPacket("clientId", MqttProtocolVersion.V3_1_1)
{
Username = "username",
Password = password,
};
connectPacket.Username.Should().Be("username");
connectPacket.Password.Should().BeEquivalentTo(password);
}
}

// create test cases for estimating the size of the packet
public class WhenEstimatingPacketSize
{
Expand All @@ -129,7 +113,7 @@ [Fact] public void should_estimate_correct_size()
var connectPacket = new ConnectPacket("clientId", MqttProtocolVersion.V3_1_1)
{
Username = "username",
Password = new byte[] { 1, 2, 3 },
Password = new ReadOnlyMemory<byte>(new byte[] { 1, 2, 3 }),
Will = new MqttLastWill("topic", new byte[] { 1, 2, 3 }),
ReceiveMaximum = 10, // should be ignored - only supported in MQTT 5.0
MaximumPacketSize = 100, // should be ignored - only supported in MQTT 5.0
Expand Down

0 comments on commit 5121d7f

Please sign in to comment.