Beispiel #1
0
        public void Transformations_AbstractTrace_ResolveWhere2()
        {
            AssertExtensions.AssertContainsOnly(trace.ResolveInWhere <string>(ruleTN, o => o.ArrayEquals(new object[] { "a", "b", "c" })), "d");
            AssertExtensions.AssertContainsOnly(trace.ResolveInWhere <string>(ruleTN, o => o.ArrayEquals(new object[] { "b", "c", "d" })), null);
            trace.ResolveInWhere <string>(ruleTN, o => o.ArrayEquals(new object[] { "c", "d", "e" })).AssertEmpty();

            var types = new Type[] { typeof(string), typeof(string), typeof(string) };

            AssertExtensions.AssertContainsOnly(trace.ResolveWhere <string>(types, o => o.ArrayEquals(new object[] { "a", "b", "c" })), "d");
            AssertExtensions.AssertContainsOnly(trace.ResolveWhere <string>(types, o => o.ArrayEquals(new object[] { "b", "c", "d" })), null);
            trace.ResolveWhere <string>(types, o => o.ArrayEquals(new object[] { "c", "d", "e" })).AssertEmpty();

            trace.ResolveWhere <string, string>(s => s == "a").AssertContainsOnly("b");
            trace.ResolveWhere <string, string>(s => s == "b").AssertContainsOnly(null);
            trace.ResolveWhere <string, string>(null).AssertContainsOnly("b", null);

            trace.ResolveWhere <string, string, string>((s1, s2) => s1 == "a" && s2 == "b").AssertContainsOnly("c");
            trace.ResolveWhere <string, string, string>((s1, s2) => s1 == "b" && s2 == "c").AssertContainsOnly(null);
            trace.ResolveWhere <string, string, string>(null).AssertContainsOnly("c", null);
        }