Created
January 6, 2014 01:44
-
-
Save gordonwatts/8276879 to your computer and use it in GitHub Desktop.
A test that shows how the current re-linq infrastructure doesn't push through and remove all anonymous object references.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void CreateFullEventNoCrossCutAllAnonMin() | |
{ | |
var q = new QueriableDummyNoExe<LINQToTTreeLib.ResultOperators.ROFirstLastTest.ntup3>(); | |
var result = from d in q | |
select new | |
{ | |
matches = from j in d.run1.Select(i => new { pt = i }) | |
select j | |
}; | |
var r1 = result.SelectMany(m => m.matches).Select(j => j.pt).Sum(); | |
var qm = DummyQueryExectuor.LastQueryModel; | |
//ReferencedQueryExpressionReplacement.Replace(qm); | |
Console.WriteLine("Replaced qm: {0}", qm.ToString()); | |
Assert.IsFalse(qm.ContainsClassRef("Anon", "Jet", "TruthJet", "MatchedJet", "matchedEvent"), "still has bogusobject"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test Name: CreateFullEventNoCrossCutAllAnonMin | |
Test Outcome: Failed | |
Result Message: Assert.IsFalse failed. still has bogusobject | |
Result StandardOutput: | |
Replaced qm: from ntup3 d in value(LINQToTTreeLib.Tests.QueriableDummyNoExe`1[LINQToTTreeLib.ResultOperators.ROFirstLastTest+ntup3]) from <>f__AnonymousTypea0`1 j in {from Int32 i in [d].run1 select new <>f__AnonymousTypea0`1(pt = [i])} select [j].pt => Sum() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment