Example #1
0
        public void TestJsonConfigurationDifferentOutputDirectory()
        {
            string configDirectory = this.GetJsonConfigurationDirectory("Configuration");
            string configPath      = Path.Combine(configDirectory, "Test.coyote.json");

            Assert.True(File.Exists(configPath));

            var config = RewritingConfiguration.ParseFromJSON(configPath);

            Assert.NotNull(config);
            config.PlatformVersion = GetPlatformVersion();

            Assert.Equal(Path.Combine(configDirectory, "Input"), config.AssembliesDirectory);
            Assert.Equal(Path.Combine(configDirectory, "Input", "Output"), config.OutputDirectory);
            Assert.False(config.IsReplacingAssemblies);

            Assert.Single(config.AssemblyPaths);
            Assert.Equal(Path.Combine(config.AssembliesDirectory, "Test.dll"), config.AssemblyPaths.First());
        }
Example #2
0
        public void TestJsonConfigurationReplacingBinaries()
        {
            string configDirectory = this.GetJsonConfigurationDirectory();
            string configPath      = Path.Combine(configDirectory, "BinaryRewritingTests.coyote.json");

            Assert.True(File.Exists(configPath));

            var config = RewritingConfiguration.ParseFromJSON(configPath);

            Assert.NotNull(config);
            config.PlatformVersion = GetPlatformVersion();

            Assert.Equal(configDirectory, config.AssembliesDirectory);
            Assert.Equal(Path.Combine(configDirectory), config.OutputDirectory);
            Assert.True(config.IsReplacingAssemblies);

            Assert.Single(config.AssemblyPaths);
            Assert.Equal(Path.Combine(config.AssembliesDirectory, "Microsoft.Coyote.BinaryRewriting.Tests.dll"), config.AssemblyPaths.First());
        }