public void ShouldThrowNullArgumentException() { const string text = null; var strategy = new NormalizationStrategy(); Assert.Throws <ArgumentNullException>(() => strategy.Translate(text)); }
public void ShouldNormalize(string value, string expectation) { var strategy = new NormalizationStrategy(); var translated = strategy.Translate(value); Assert.Equal(expectation, translated); }
public WLCTool(DataTable dataTable, ToolParameterContainer toolParameterContainer) { _backupDataTable = dataTable.Copy(); _workingDataTable = _backupDataTable; this._toolParameterContainer = toolParameterContainer; _transformationStrategy = Model.NormalizationStrategy.MaximumScoreNormalizationStrategy; }
public Cluster(int featureId, IList <int> clusterIDs, DataTable dt, ToolParameterContainer toolParameterContainer, NormalizationStrategy transformationStrategy) { _featureId = featureId; _clusterIDs = clusterIDs; _dataTable = dt; _enumerableRowCollection = _dataTable.AsEnumerable(); _toolParameterContainer = toolParameterContainer; _transformationStrategy = transformationStrategy; //the feature id is also part of the cluster! _clusterIDs.Add(featureId); }
public static INormalizationStrategy GetStrategy(NormalizationStrategy transformationStrategy) { switch (transformationStrategy) { case NormalizationStrategy.MaximumScoreNormalizationStrategy: return(new MaximumScoreNormalizationStrategy()); case NormalizationStrategy.ScoreRangeNormalizationStrategy: return(new ScoreRangeNormalizationStrategy()); case NormalizationStrategy.IdentityNormalizationStrategy: return(new IdentityNormalizationStrategy()); case NormalizationStrategy.DefaultNormalizationStrategy: return(new MaximumScoreNormalizationStrategy()); default: return(new MaximumScoreNormalizationStrategy()); } }