Пример #1
0
        public void OfValue_WhenNullValueSpecified_ThrowsException()
        {
            // Arrange

            // Act

            // Assert
            Assert.Throws <System.ArgumentNullException>(() => {
                TupleParameterValue.OfValue(null);
            });
        }
Пример #2
0
        public void OfValue_WhenNotNullValueSpecified_ReturnsInstance()
        {
            // Arrange
            ITuple t0 = Tuple.FromCollection(new ITupleEntry[] {
                TupleEntry.OfValue("v0"), TupleEntry.OfPair("k1", "v1")
            }.ToList());
            IParameterValue pv0 = TupleParameterValue.OfValue(t0);
            IParameterValue pv1 = TupleParameterValue.OfValue(Tuple.Empty);

            // Act

            // Assert
            Assert.That(pv0.StringValue, Is.EqualTo("(v0,k1=v1)"));
            Assert.That(pv1.StringValue, Is.EqualTo("()"));
        }
Пример #3
0
        private IParameterValue ParseParamValue(Input input)
        {
            switch (input.Current)
            {
            case '(':
                ITuple t = tupleParser.Parse(input);
                return(TupleParameterValue.OfValue(t));

            case '"':
                string q = ParseQuotedString(input);
                return(QuotedStringParameterValue.OfValue(q));

            default:
                string s = ParseRawString(input);
                return(RawStringParameterValue.OfValue(s));
            }
        }