Beispiel #1
0
        public virtual void test_combinedWith_differentTypes()
        {
            ValueWithFailures <bool>   @base = ValueWithFailures.of(true, ImmutableList.of(FAILURE1));
            ValueWithFailures <int>    other = ValueWithFailures.of(Convert.ToInt32(1), ImmutableList.of(FAILURE2));
            ValueWithFailures <string> test  = @base.combinedWith(other, (a, b) => a.ToString() + b.ToString());

            assertEquals(test.Value, "true1");
            assertEquals(test.Failures, ImmutableList.of(FAILURE1, FAILURE2));
        }
Beispiel #2
0
        // -------------------------------------------------------------------------
        public virtual void test_combinedWith()
        {
            ValueWithFailures <IList <string> > @base = ValueWithFailures.of(ImmutableList.of("a"), ImmutableList.of(FAILURE1));
            ValueWithFailures <IList <string> > other = ValueWithFailures.of(ImmutableList.of("b", "c"), ImmutableList.of(FAILURE2));
            ValueWithFailures <IList <string> > test  = @base.combinedWith(other, Guavate.concatToList);

            assertEquals(test.Value, ImmutableList.of("a", "b", "c"));
            assertEquals(test.Failures, ImmutableList.of(FAILURE1, FAILURE2));
        }