public void ShouldSupportIEnumerableTypes() { var context = new TypeContext(new Settings()); var resolvedType = context.GetTypeScriptType(typeof(IEnumerable <String>).FullName); Assert.IsInstanceOfType(resolvedType, typeof(ArrayType)); resolvedType = context.GetTypeScriptType("System.Collections.Generic.IEnumerable<System.String>"); Assert.IsInstanceOfType(resolvedType, typeof(ArrayType)); }
public void ShouldSupportDicionaryTypes() { var context = new TypeContext(new Settings()); var resolvedType = context.GetTypeScriptType(typeof(Dictionary <String, float>).FullName); Assert.IsInstanceOfType(resolvedType, typeof(DictionaryType)); resolvedType = context.GetTypeScriptType("System.Collections.Generic.Dictionary<System.String, System.Float>"); Assert.IsInstanceOfType(resolvedType, typeof(DictionaryType)); }
public void ShouldSupportNumberTypes() { var inputTypes = new [] { typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint), typeof(long), typeof(ulong), typeof(float), typeof(decimal), typeof(double) }; var context = new TypeContext(new Settings()); var expectedType = typeof(NumberType); foreach (var type in inputTypes) { var resolvedType = context.GetTypeScriptType(type.FullName); Assert.IsInstanceOfType(resolvedType, expectedType); } }
public void ShouldSupportDatetimeOffsetAsStrings() { var context = new TypeContext(new Settings { UseNativeDates = false }); var resolvedType = context.GetTypeScriptType(typeof(DateTimeOffset).FullName); Assert.IsInstanceOfType(resolvedType, typeof(StringType)); }
public void ShouldSupportDatetimesAsNativeDates() { var context = new TypeContext(new Settings { UseNativeDates = true }); var resolvedType = context.GetTypeScriptType(typeof(DateTime).FullName); Assert.IsInstanceOfType(resolvedType, typeof(DateTimeType)); }
public void ShouldSupportDicionaryTypes() { var context = new TypeContext(new Settings()); var resolvedType = context.GetTypeScriptType(typeof(Dictionary<String, float>).FullName); Assert.IsInstanceOfType(resolvedType, typeof(DictionaryType)); resolvedType = context.GetTypeScriptType("System.Collections.Generic.Dictionary<System.String, System.Float>"); Assert.IsInstanceOfType(resolvedType, typeof(DictionaryType)); }
public void ShouldSupportIEnumerableTypes() { var context = new TypeContext(new Settings()); var resolvedType = context.GetTypeScriptType(typeof(IEnumerable<String>).FullName); Assert.IsInstanceOfType(resolvedType, typeof(ArrayType)); resolvedType = context.GetTypeScriptType("System.Collections.Generic.IEnumerable<System.String>"); Assert.IsInstanceOfType(resolvedType, typeof(ArrayType)); }