Esempio n. 1
0
        private static void Main(string[] args)
        {
            var bootstrapper = new Bootstrapper();

            bootstrapper.Start(args);
        }
 public IntegrationTest()
 {
     bootstrapper = new Vipr.Bootstrapper();
 }
Esempio n. 3
0
        public void When_a_custom_reader_is_specified_then_it_is_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var commandLine = String.Format("{0} --reader=TestReaderWriter", metadataUri);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                bootstrapper.OdcmReader.GetType().Should().Be(typeof (TestReaderWriter.TestReaderWriter));

                bootstrapper.OdcmWriter.GetType().Should().Be(typeof(Vipr.Writer.CSharp.CSharpWriter));

                if(Directory.Exists(FileSystem.DEFAULT_OUTPUT_DIRECTORY)) Directory.Delete(FileSystem.DEFAULT_OUTPUT_DIRECTORY, true);
            });
        }
Esempio n. 4
0
        public void When_empty_string_outputPath_is_specified_then_current_working_dir_is_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var outputPath = String.Empty;

                var commandLine = String.Format("{0} --outputPath={1}", metadataUri, outputPath);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                var filePath = Path.Combine(outputPath, FileSystem.CSHARP_WRITER_OUTPUT);

                File.Exists(filePath).Should().BeTrue("Because one expected output file was found in the specified output directory.");
                //Path.GetFullPath(outputPath).Should().BeEquivalentTo(Path.GetFullPath(_workingDirectory),
                //        "Because empty string means current working directory.");

                // if (Directory.Exists(outputPath)) Directory.Delete(outputPath, true);
                if (File.Exists(filePath)) File.Delete(filePath);
            });
        }
Esempio n. 5
0
        public void When_two_level_outputPath_is_specified_then_it_is_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var outputPath = Path.Combine(Any.Word(), Any.Word());

                var commandLine = String.Format("{0} --outputPath={1}", metadataUri, outputPath);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                var filePath = Path.Combine(outputPath, FileSystem.CSHARP_WRITER_OUTPUT);

                File.Exists(filePath).Should().BeTrue("Because one expected output file was found in the specified output directory.");

                if (Directory.Exists(outputPath)) Directory.Delete(outputPath, true);
            });
        }
Esempio n. 6
0
        public void When_custom_outputPath_is_not_specified_then_defaults_are_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var commandLine = String.Format("{0}", metadataUri);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                var pathToOneExpectedOutputFile = Path.Combine(FileSystem.DEFAULT_OUTPUT_DIRECTORY, FileSystem.CSHARP_WRITER_OUTPUT);

                File.Exists(pathToOneExpectedOutputFile).Should().BeTrue("Because one expected output file was created in default output directory.");

                if (Directory.Exists(FileSystem.DEFAULT_OUTPUT_DIRECTORY)) Directory.Delete(FileSystem.DEFAULT_OUTPUT_DIRECTORY, true);
            });
        }
Esempio n. 7
0
        public void When_a_custom_writer_is_specified_then_it_is_used()
        {
            var metadata = ODataV4.EmptyEdmx;

            WithWebMetadata(metadata, metadataUri =>
            {
                var commandLine = String.Format("{0} --writer=TestReaderWriter", metadataUri);

                var bootstrapper = new Bootstrapper();

                bootstrapper.Start(commandLine.Split(' '));

                bootstrapper.OdcmReader.GetType().Should().Be(typeof (Vipr.Reader.OData.v4.OdcmReader));

                bootstrapper.OdcmWriter.GetType().Should().Be(typeof (TestReaderWriter.TestReaderWriter));
            });
        }