예제 #1
0
        public void DefaultTypescriptVersionYieldsBoolean()
        {
            TypeContext typeContext = new TypeContext();

            var sb     = new StringBuilder();
            var member = new TypeScriptMember
            {
                Name = "Foo",
                Type = typeContext.GetTypeReference(
                    TypeName.FromLiteral(typeof(bool).FullName),
                    contextTypeReference: null)
            };

            var appender = new MemberOutputAppender(
                new OutputSettings
            {
                CompatibilityVersion = null
            },
                new TypeContext());

            appender.AppendOutput(
                sb,
                0,
                member);
            Assert.AreEqual("Foo: boolean;", sb.ToString().Trim());
        }
예제 #2
0
        public void TypescriptVersion083YieldsBool()
        {
            Version     version     = new Version(0, 8, 3);
            TypeContext typeContext = new TypeContext(new TypeContext.Settings()
            {
                CompatibilityVersion = version
            });

            var sb     = new StringBuilder();
            var member = new TypeScriptMember
            {
                Name = "Foo",
                Type = typeContext.GetTypeReference(
                    TypeName.FromLiteral(typeof(bool).FullName),
                    contextTypeReference: null)
            };

            var appender = new MemberOutputAppender(
                new OutputSettings
            {
                CompatibilityVersion = version
            },
                typeContext);

            appender.AppendOutput(
                sb,
                0,
                member);
            Assert.AreEqual("Foo: bool;", sb.ToString().Trim());
        }