public void OfValue_WhenNullValueSpecified_ThrowsException() { // Arrange // Act // Assert Assert.Throws <System.ArgumentNullException>(() => { TupleParameterValue.OfValue(null); }); }
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("()")); }
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)); } }