Пример #1
0
        public void Can_Retrieve_PropertyName_From_Expression()
        {
            Expression <Func <TimeSpan, object> > expr = (ts) => ts.TotalMilliseconds;

            var propertyName = LinqTool.FindPropertyName(expr.Body);

            propertyName.Should().Be("TotalMilliseconds");
        }
        public void PartitioningArrayTest(int partitionCount, double totalAmount)
        {
            foreach (var value in Enum.GetValues(typeof(PartitioningMethod)))
            {
                var method = (PartitioningMethod)value;
                var array  = LinqTool.Partitioning(method, partitionCount, totalAmount);

                Console.WriteLine("array=" + array.CollectionToString());
            }
        }
        public void DefaultPartitioningArrayTest()
        {
            foreach (var value in Enum.GetValues(typeof(PartitioningMethod)))
            {
                var method = (PartitioningMethod)value;
                var array  = LinqTool.Partitioning(method);

                array.SequenceEqual(LinqTool.DefaultPartitioningArray[method]).Should().Be.True();
            }
        }