public void GetSymbol() { SymbolTable table = new SymbolTable(); table.AddSymbol("Com.Autodesk.Designscript.ProtoGeometry.Point"); var symbol = table.GetMatchingSymbols("Com.Autodesk.Point").First(); Assert.AreEqual("Point", symbol.Name); Assert.AreEqual("Com.Autodesk.Designscript.ProtoGeometry.Point", symbol.FullName); Assert.AreEqual(symbol.FullName, table.GetFullyQualifiedName("Point")); Assert.AreEqual(symbol.FullName, table.GetFullyQualifiedName("Autodesk.ProtoGeometry.Point")); Assert.AreEqual(symbol.FullName, table.GetFullyQualifiedName("Designscript.ProtoGeometry.Point")); Assert.IsEmpty(table.GetMatchingSymbols("Com.Designscript.Autodesk.Point")); Assert.Throws<System.Collections.Generic.KeyNotFoundException>(()=>table.GetMatchingSymbols("Com.Autodesk.Designscript.ProtoGeometry")); }
public void GetSymbolMultipleInput() { SymbolTable table = new SymbolTable(); table.AddSymbol("Autodesk.ProtoGeometry.Point"); table.AddSymbol("Autodesk.Designscript.Point"); table.AddSymbol("Com.Autodesk.Point"); Assert.AreEqual(3, table.GetSymbolCount()); Assert.AreEqual("Com.Autodesk.Point", table.GetFullyQualifiedName("Com.Point")); Assert.AreEqual("Autodesk.ProtoGeometry.Point", table.GetFullyQualifiedName("ProtoGeometry.Point")); Assert.AreEqual("Autodesk.Designscript.Point", table.GetFullyQualifiedName("Designscript.Point")); Assert.Throws<System.Collections.Generic.KeyNotFoundException>(()=>table.GetFullyQualifiedName("Point")); Assert.Throws<System.Collections.Generic.KeyNotFoundException>(() => table.GetFullyQualifiedName("Autodesk.Point")); }