public static void Max_Other_SomeNull(Labeled <ParallelQuery <int> > labeled, int count, int max) { ParallelQuery <int> query = labeled.Item; Assert.Equal(max, query.Max(x => x >= count / 2 ? DelgatedComparable.Delegate(x, Comparer <int> .Default) : null).Value); Assert.Equal(count / 2, query.Max(x => x >= count / 2 ? DelgatedComparable.Delegate(x, ReverseComparer.Instance) : null).Value); }
public static void Max_Long(Labeled <ParallelQuery <int> > labeled, int count, long max) { ParallelQuery <int> query = labeled.Item; Assert.Equal(max, query.Select(x => (long)x).Max()); Assert.Equal(max, query.Select(x => (long?)x).Max()); Assert.Equal(0, query.Max(x => - (long)x)); Assert.Equal(0, query.Max(x => - (long?)x)); }
public static void Max_Int(Labeled <ParallelQuery <int> > labeled, int count, int max) { ParallelQuery <int> query = labeled.Item; Assert.Equal(max, query.Max()); Assert.Equal(max, query.Select(x => (int?)x).Max()); Assert.Equal(0, query.Max(x => - x)); Assert.Equal(0, query.Max(x => - (int?)x)); }
public static void Max_Decimal(Labeled <ParallelQuery <int> > labeled, int count, decimal max) { ParallelQuery <int> query = labeled.Item; Assert.Equal(max, query.Select(x => (decimal)x).Max()); Assert.Equal(max, query.Select(x => (decimal?)x).Max()); Assert.Equal(0, query.Max(x => - (decimal)x)); Assert.Equal(0, query.Max(x => - (decimal?)x)); }
public static void Max_Double(Labeled <ParallelQuery <int> > labeled, int count, double max) { ParallelQuery <int> query = labeled.Item; Assert.Equal(max, query.Select(x => (double)x).Max()); Assert.Equal(max, query.Select(x => (double?)x).Max()); Assert.Equal(0, query.Max(x => - (double)x)); Assert.Equal(0, query.Max(x => - (double?)x)); Assert.Equal(double.PositiveInfinity, query.Select(x => x == count / 2 ? double.PositiveInfinity : x).Max()); Assert.Equal(double.PositiveInfinity, query.Select(x => x == count / 2 ? (double?)double.PositiveInfinity : x).Max()); }
public static void Max_Float(Labeled <ParallelQuery <int> > labeled, int count, float max) { ParallelQuery <int> query = labeled.Item; Assert.Equal(max, query.Select(x => (float)x).Max()); Assert.Equal(max, query.Select(x => (float?)x).Max()); Assert.Equal(0, query.Max(x => - (float)x)); Assert.Equal(0, query.Max(x => - (float?)x)); Assert.Equal(float.PositiveInfinity, query.Select(x => x == count / 2 ? float.PositiveInfinity : x).Max()); Assert.Equal(float.PositiveInfinity, query.Select(x => x == count / 2 ? (float?)float.PositiveInfinity : x).Max()); }
public static void Max_Int_AllNull(Labeled <ParallelQuery <int> > labeled, int count, int max) { ParallelQuery <int> query = labeled.Item; Assert.Null(query.Select(x => (int?)null).Max()); Assert.Null(query.Max(x => (int?)null)); }
public static void Max_Int_SomeNull(Labeled <ParallelQuery <int> > labeled, int count, int max) { ParallelQuery <int> query = labeled.Item; Assert.Equal(max, query.Select(x => x >= count / 2 ? (int?)x : null).Max()); Assert.Equal(-count / 2, query.Max(x => x >= count / 2 ? -(int?)x : null)); }
public static void Max_Decimal_AllNull(Labeled <ParallelQuery <int> > labeled, int count, decimal max) { ParallelQuery <int> query = labeled.Item; Assert.Null(query.Select(x => (decimal?)null).Max()); Assert.Null(query.Max(x => (decimal?)null)); }
protected virtual void ShowOpenShipments(IEnumerable <FinPeriod> periods) { ParallelQuery <string> periodIDs = periods.Select(fp => fp.FinPeriodID).AsParallel(); Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters["FromPeriodID"] = FinPeriodIDFormattingAttribute.FormatForDisplay(periodIDs.Min()); parameters["ToPeriodID"] = FinPeriodIDFormattingAttribute.FormatForDisplay(periodIDs.Max()); Organization org = OrganizationMaint.FindOrganizationByID(this, Filter.Current.OrganizationID); parameters["OrgID"] = org?.OrganizationCD; throw new PXReportRequiredException(parameters, "IN656500", PXBaseRedirectException.WindowMode.NewWindow, "Documents Not Posted to Inventory"); }