Exemplo n.º 1
0
        public void ExecutePortable()
        {
            PreCompileContext ctx;

            Assert.IsTrue(CommandLineAttribute.TryParse(new[] { @"..\..\..\SO11895998_Portable\bin\release\SO11895998_Portable.dll"
                                                                , "-o:SO11895998_PortableSerializer.dll", "-t:MySerializer" }, out ctx), "TryParse");
            Assert.IsTrue(ctx.SanityCheck(), "SanityCheck");
            Assert.IsTrue(ctx.Execute(), "Execute");
        }
Exemplo n.º 2
0
        public void ExecuteNet45WithInternalTypes()
        {
            PreCompileContext ctx;

            Assert.IsTrue(CommandLineAttribute.TryParse(new[] { @"..\..\..\Net45Dto\bin\release\Net45Dto.dll"
                                                                , @"-o:..\..\..\Net45Dto\bin\release\Net45Serializer.dll", "-t:MySerializer" }, out ctx), "TryParse");
            Assert.IsTrue(ctx.SanityCheck(), "SanityCheck");
            Assert.IsTrue(ctx.Execute(), "Execute");
            PEVerify.AssertValid(@"..\..\..\Net45Dto\bin\release\Net45Serializer.dll");
        }
Exemplo n.º 3
0
        public void TestOverallUsage()
        {
            PreCompileContext ctx;

            Assert.IsTrue(CommandLineAttribute.TryParse(new[] { "a.dll", "-o:out.dll", "-t:Type" }, out ctx), "TryParse");
            Assert.AreEqual("Type", ctx.TypeName);
            Assert.AreEqual("out.dll", ctx.AssemblyName);
            Assert.AreEqual(1, ctx.Inputs.Count);
            Assert.AreEqual("a.dll", ctx.Inputs[0]);
        }
Exemplo n.º 4
0
        public void TestHelpUsage()
        {
            PreCompileContext ctx;

            Assert.IsTrue(CommandLineAttribute.TryParse(new[] { "-?" }, out ctx), "TryParse -?");
            Assert.IsTrue(ctx.Help, "Help -?");
            Assert.IsTrue(CommandLineAttribute.TryParse(new[] { "-h" }, out ctx), "TryParse -h");
            Assert.IsTrue(ctx.Help, "Help -h");
            Assert.IsTrue(CommandLineAttribute.TryParse(new[] { "-help" }, out ctx), "TryParse -help");
            Assert.IsTrue(ctx.Help, "Help -help");
        }
Exemplo n.º 5
0
        public void TestFullPath()
        {
            PreCompileContext ctx;

            Assert.IsTrue(CommandLineAttribute.TryParse(new[] { @"c:\a.dll", "b.dll", "-o:out.dll", "-t:Type" }, out ctx), "TryParse");
            Assert.AreEqual("Type", ctx.TypeName);
            Assert.AreEqual("out.dll", ctx.AssemblyName);
            Assert.AreEqual(2, ctx.Inputs.Count);
            Assert.AreEqual(@"c:\a.dll", ctx.Inputs[0]);
            Assert.AreEqual("b.dll", ctx.Inputs[1]);
        }
Exemplo n.º 6
0
        public void ExecuteNet11()
        {
            PreCompileContext ctx;

            //string framework = Environment.ExpandEnvironmentVariables(@"%windir%\Microsoft.NET\Framework\v1.1.4322");
            Assert.IsTrue(CommandLineAttribute.TryParse(new[] { @"..\..\..\Net11_Poco\bin\release\Net11_Poco.dll"
                                                                //, "-f:" + framework
                                                                , "-o:Net11Serializer.dll", "-t:MySerializer" }, out ctx), "TryParse");
            Assert.IsTrue(ctx.SanityCheck(), "SanityCheck");
            Assert.IsTrue(ctx.Execute(), "Execute");
        }
Exemplo n.º 7
0
        public void ExecuteSigned()
        {
            PreCompileContext ctx;

            Assert.IsTrue(CommandLineAttribute.TryParse(new[] { @"..\..\..\SignedDto\bin\release\SignedDto.dll"
                                                                , @"-o:..\..\..\SignedDto\bin\release\SignedSerializer.dll",
                                                                "-t:MySignedSerializer",
                                                                @"-keyfile:..\..\..\AqlaSerializer2Key.snk" }, out ctx), "TryParse");
            Assert.IsTrue(ctx.SanityCheck(), "SanityCheck");
            Assert.IsTrue(ctx.Execute(), "Execute");
            PEVerify.AssertValid(@"..\..\..\SignedDto\bin\release\SignedSerializer.dll");
        }