Ejemplo n.º 1
0
        public static void AssertOnResultUpdateWorks <T>(this IContinuousCorrelater <T> correlater, IEnumerable <T> collection1, IEnumerable <T> collection2)
        {
            var matchArray1 = new List <T>();
            var matchArray2 = new List <T>();

            correlater.OnResultUpdate += (result) =>
            {
                matchArray1.AddRange(result.BestMatch1);
                matchArray2.AddRange(result.BestMatch2);
            };

            var actualResult = correlater.Correlate(collection1, collection2);

            matchArray1.AssertAreSame(actualResult.BestMatch1, "Got wrong updates");
            matchArray2.AssertAreSame(actualResult.BestMatch2, "Got wrong updates");
        }