public void CanBeConstructedFromClosedGenericClrTypes() { var closedEnumerable = new NamedType(typeof(IEnumerable <int>)); closedEnumerable.ShouldEqual( "System.Collections.Generic.IEnumerable", "System.Collections.Generic.IEnumerable<int>", NamedType.Integer); }
public void CanBeConstructedFromClosedGenericClrTypes() { var closedEnumerable = new NamedType(typeof(IEnumerable<int>)); closedEnumerable.ShouldEqual( "System.Collections.Generic.IEnumerable", "System.Collections.Generic.IEnumerable<int>", NamedType.Integer); }
public void CanBeConstructedFromOpenGenericClrTypes() { using (TypeVariable.TestFactory()) { var openEnumerable = new NamedType(typeof(IEnumerable <>)); openEnumerable.ShouldEqual( "System.Collections.Generic.IEnumerable", "System.Collections.Generic.IEnumerable<0>", new TypeVariable(0)); } }
public void CanBeConstructedFromOpenGenericClrTypes() { using (TypeVariable.TestFactory()) { var openEnumerable = new NamedType(typeof(IEnumerable<>)); openEnumerable.ShouldEqual( "System.Collections.Generic.IEnumerable", "System.Collections.Generic.IEnumerable<0>", new TypeVariable(0)); } }
public void CanBeConstructedFromRookClassDeclarationsIncludingMethods() { var @class = "class Foo { int Square(int x) {x*x} }".ParseClass(); var foo = new NamedType(@class, new TypeRegistry()); foo.ShouldEqual("Foo", "Foo"); foo.Methods.ShouldList( method => { method.Identifier.ShouldEqual("Square"); method.Type.ShouldEqual(NamedType.Function(new[] {NamedType.Integer}, NamedType.Integer)); }); }