public void Equals_SameSerializerSettings_TrueIsReturned() { var endpoint1 = new MqttProducerEndpoint("topic") { Configuration = { ClientId = "client1" }, Serializer = new JsonMessageSerializer { Options = { MaxDepth = 100 } } }; var endpoint2 = new MqttProducerEndpoint("topic") { Configuration = { ClientId = "client1" }, Serializer = new JsonMessageSerializer { Options = { MaxDepth = 100 } } }; endpoint1.Equals(endpoint2).Should().BeTrue(); }
public void Validate_InvalidConfiguration_ExceptionThrown() { var endpoint = new MqttProducerEndpoint("topic") { Configuration = new MqttClientConfig() }; Action act = () => endpoint.Validate(); act.Should().ThrowExactly <EndpointConfigurationException>(); }
public void Equals_SameEndpointInstance_TrueIsReturned() { var endpoint = new MqttProducerEndpoint("topic") { Configuration = { ClientId = "client1" } }; endpoint.Equals(endpoint).Should().BeTrue(); }
public void Validate_MissingTopic_ExceptionThrown() { var endpoint = new MqttProducerEndpoint(string.Empty) { Configuration = new MqttClientConfig { ChannelOptions = new MqttClientTcpOptions { Server = "test-server" } } }; Action act = () => endpoint.Validate(); act.Should().ThrowExactly <EndpointConfigurationException>(); }
public void Equals_DifferentConfiguration_FalseIsReturned() { var endpoint1 = new MqttProducerEndpoint("topic") { Configuration = { ClientId = "client1" } }; var endpoint2 = new MqttProducerEndpoint("topic") { Configuration = { ClientId = "client2" } }; endpoint1.Equals(endpoint2).Should().BeFalse(); }
public void Validate_ChunkingEnabledOnV500_ExceptionThrown() { var endpoint = new MqttProducerEndpoint("topic") { Configuration = new MqttClientConfig { ChannelOptions = new MqttClientTcpOptions { Server = "test-server" } }, Chunk = new ChunkSettings { Size = 10 } }; Action act = () => endpoint.Validate(); act.Should().ThrowExactly <EndpointConfigurationException>(); }