public void ShouldNotCollectIfNoValueIsGiven() { var collector = new ConfigurationHintsCollector(); collector.Collect(new Dictionary <string, object>()); collector.Collected.Should().BeNull(); }
public void ShouldNotCollectIfMetadataIsNull() { var collector = new ConfigurationHintsCollector(); collector.Collect(null); collector.Collected.Should().BeNull(); }
public void ShouldThrowIfValueIsOfWrongType() { var metadata = new Dictionary <string, object> { { Key, "WrongType" } }; var collector = new ConfigurationHintsCollector(); var ex = Record.Exception(() => collector.Collect(metadata)); ex.Should().BeOfType <ProtocolException>().Which .Message.Should().Contain($"Expected '{Key}' metadata to be of type 'Dictionary<string, object>', but got 'String'."); }
public void ShouldCollect() { var hintsMetadata = new Dictionary <string, object>() { { RecvTimeoutKey, 5 } }; var metadata = new Dictionary <string, object>() { { Key, hintsMetadata } }; var collector = new ConfigurationHintsCollector(); collector.Collect(metadata); collector.Collected.Equals(hintsMetadata); }