예제 #1
0
        public void Single_Include_Only_Should_Equal_Output()
        {
            var context = new PartialPatientCountContext[]
            {
                new PartialPatientCountContext
                {
                    PatientIds = new HashSet <string>
                    {
                        "123", "234", "345", "456"
                    },
                    IsInclusionCriteria = true
                }
            };

            var agg = new PatientCountAggregator().Aggregate(context);

            Assert.True(agg.SequenceEqual(context.ElementAt(0).PatientIds));
        }
예제 #2
0
        public void Complex_Context_Aggregates_Correctly()
        {
            var context = new PartialPatientCountContext[]
            {
                new PartialPatientCountContext
                {
                    PatientIds = new HashSet <string>
                    {
                        "123", "234", "345", "456"
                    },
                    IsInclusionCriteria = true
                },
                new PartialPatientCountContext
                {
                    PatientIds = new HashSet <string>
                    {
                        "234", "345", "456"
                    },
                    IsInclusionCriteria = true
                },
                new PartialPatientCountContext
                {
                    PatientIds = new HashSet <string>
                    {
                        "456"
                    },
                    IsInclusionCriteria = false
                }
            };

            var expected = new string[] { "234", "345" };

            var agg = new PatientCountAggregator().Aggregate(context);

            Assert.True(expected.SequenceEqual(agg));
        }