private RatingAdjustment(IParsedReview review, IMachineSentiment model) : base(review) { if (review is null) { throw new ArgumentNullException(nameof(review)); } Model = model ?? throw new ArgumentNullException(nameof(model)); }
public static IRatingAdjustment Create(IParsedReview review, IMachineSentiment model = null) { if (model == null || model is NullMachineSentiment) { return(new NullRatingAdjustment(review)); } var adjustment = new RatingAdjustment(review, model); adjustment.CalculateRating(); return(adjustment); }