Ejemplo n.º 1
0
        public void ExportInterfaceTwice()
        {
            TSBuilder builder = new TSBuilder();

            builder.ExportInterface("A", tsInterface => { });
            builder.ExportInterface("B", tsInterface => { });
            AssertEx.EqualLines(new[]
            {
                "export interface A {",
                "}",
                "export interface B {",
                "}"
            },
                                builder);
        }
Ejemplo n.º 2
0
        public void ExportInterfaceWithExtendedTypeTwiceWithProperties()
        {
            TSBuilder builder = new TSBuilder();

            builder.ExportInterface("A", "L", tsInterface =>
            {
                tsInterface.Property("y", "number");
            });
            builder.ExportInterface("B", "M", tsInterface =>
            {
                tsInterface.Property("z", "boolean");
            });
            AssertEx.EqualLines(new[]
            {
                "export interface A extends L {",
                "  y: number;",
                "}",
                "export interface B extends M {",
                "  z: boolean;",
                "}"
            },
                                builder);
        }