コード例 #1
0
        public void ShouldCollectFalseIfNoValueIsGiven()
        {
            var collector = new HasMoreCollector();

            collector.Collect(new Dictionary <string, object>());

            collector.Collected.Should().BeFalse();
        }
コード例 #2
0
        public void ShouldCollectFalseIfMetadataIsNull()
        {
            var collector = new HasMoreCollector();

            collector.Collect(null);

            collector.Collected.Should().BeFalse();
        }
コード例 #3
0
        public void ShouldReturnSameCollected()
        {
            var metadata = new Dictionary <string, object> {
                { Key, true }
            };
            var collector = new HasMoreCollector();

            collector.Collect(metadata);

            ((IMetadataCollector)collector).Collected.Should().Be(collector.Collected);
        }
コード例 #4
0
        public void ShouldCollect()
        {
            var metadata = new Dictionary <string, object> {
                { Key, true }
            };
            var collector = new HasMoreCollector();

            collector.Collect(metadata);

            collector.Collected.Should().BeTrue();
        }
コード例 #5
0
        public void ShouldThrowIfValueIsOfWrongType()
        {
            var metadata = new Dictionary <string, object> {
                { Key, "some string" }
            };
            var collector = new HasMoreCollector();

            var ex = Record.Exception(() => collector.Collect(metadata));

            ex.Should().BeOfType <ProtocolException>().Which
            .Message.Should()
            .Contain($"Expected '{Key}' metadata to be of type 'Boolean', but got 'String'.");
        }