示例#1
0
 private ValueTuple Tuple(params object[] objs)
 {
     Value[] values = new Value[objs.Length];
     for (int i = 0; i < values.Length; i++)
     {
         values[i] = Values.Of(objs[i]);
     }
     return(ValueTuple.Of(values));
 }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldBeAbleToThrowFromValueWriter()
        internal virtual void ShouldBeAbleToThrowFromValueWriter()
        {
            // Given
            Value value = Values.Of("This is a value");
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            ValueWriter <TestException> writer = throwing(TestException::new);

            // Expect
            assertThrows(typeof(TestException), () => value.writeTo(writer));
        }
示例#3
0
 public static ValueTuple Of(params object[] objects)
 {
     Debug.Assert(objects.Length > 0, "Empty ValueTuple is not allowed");
     Debug.Assert(NoNulls(objects));
     Value[] values = new Value[objects.Length];
     for (int i = 0; i < values.Length; i++)
     {
         values[i] = Values.Of(objects[i]);
     }
     return(new ValueTuple(values));
 }
示例#4
0
 private static WriteTest ShouldWrite(object value, params object[] expected)
 {
     return(new WriteTest(Values.Of(value), expected));
 }
示例#5
0
 internal Test(Value a, object b, bool shouldMatch)
 {
     this.A           = a;
     this.B           = Values.Of(b);
     this.ShouldMatch = shouldMatch;
 }