public void InvalidTypes() { List <SemanticCubeUtilities.DataTypes> DataTypesList = Enum.GetValues(typeof(SemanticCubeUtilities.DataTypes)).Cast <SemanticCubeUtilities.DataTypes>().ToList(); List <SemanticCubeUtilities.Operators> OperatorsList = Enum.GetValues(typeof(SemanticCubeUtilities.Operators)).Cast <SemanticCubeUtilities.Operators>().ToList(); TypeTypeOperator tto; foreach (SemanticCubeUtilities.DataTypes typeOne in DataTypesList) { foreach (SemanticCubeUtilities.DataTypes typeTwo in DataTypesList) { foreach (SemanticCubeUtilities.Operators op in OperatorsList) { tto = new TypeTypeOperator(typeOne, typeTwo, op); if (!validTypesAndExpected.ContainsKey(tto)) { if (op == SemanticCubeUtilities.Operators.fakeBottom) { continue; // not an actual operator } Assert.AreEqual(SemanticCube.AnalyzeSemantics(tto), SemanticCubeUtilities.DataTypes.invalidDataType); } } } } }
public void ValidTypes() { foreach (KeyValuePair <TypeTypeOperator, SemanticCubeUtilities.DataTypes> validEntry in validTypesAndExpected) { Assert.AreEqual(SemanticCube.AnalyzeSemantics(validEntry.Key), validEntry.Value); } }