예제 #1
0
        public void Ids_Are_Unique()
        {
            var uniqueIds = new LinqMetaData().Device.Select(x => x.UniqueIdentifier).ToList().Concat(
                new LinqMetaData().Location.Select(x => x.UniqueIdentifier).ToList().Concat(
                    new LinqMetaData().Organization.Select(x => x.UniqueIdentifier).ToList()
                    )
                );
            var idsGrouped = uniqueIds.GroupBy(x => x, (Id, enumerable) => new { Id, Count = enumerable.Count() });

            Assert.IsTrue(!idsGrouped.Any(x => x.Count > 1));
        }