public void FakesSettingsShouldBeNotGeneratedIfFakeConfiguratorAssemblyIsNotPresent()
        {
            string runSettingsXml       = @"<RunSettings><RunConfiguration></RunConfiguration ></RunSettings>";
            var    generatedRunSettings = FakesUtilities.GenerateFakesSettingsForRunConfiguration(new string[] { @"C:\temp\UT.dll" }, runSettingsXml);

            Assert.AreEqual(generatedRunSettings, runSettingsXml);
        }
        public void FakesSettingsShouldBeNotGeneratedIfTargetFrameWorkIsNetCore()
        {
            string runSettingsXml       = @"<RunSettings><RunConfiguration><TargetFrameworkVersion>.netstandard,Version=5.0</TargetFrameworkVersion></RunConfiguration ></RunSettings>";
            var    generatedRunSettings = FakesUtilities.GenerateFakesSettingsForRunConfiguration(new string[] { }, runSettingsXml);

            Assert.AreEqual(generatedRunSettings, runSettingsXml);
        }
Пример #3
0
 internal static void GenerateFakesSettings(CommandLineOptions commandLineOptions, IEnumerable <string> sources, ref string runSettingsXml)
 {
     // dynamically compute the fakes datacollector settings
     if (!commandLineOptions.DisableAutoFakes)
     {
         runSettingsXml = FakesUtilities.GenerateFakesSettingsForRunConfiguration(sources.ToArray(), runSettingsXml);
     }
 }
 public void FakesSettingsShouldThrowExceptionIfRunSettingsIsPassedAsNull()
 {
     Assert.ThrowsException <ArgumentNullException>(() => FakesUtilities.GenerateFakesSettingsForRunConfiguration(new string[] { }, null));
 }
        public void FakesSettingsShouldThrowExceptionIfSourcesArePassedAsNull()
        {
            string runSettingsXml = @"<RunSettings><RunConfiguration><TargetFrameworkVersion>.netstandard,Version=5.0</TargetFrameworkVersion></RunConfiguration ></RunSettings>";

            Assert.ThrowsException <ArgumentNullException>(() => FakesUtilities.GenerateFakesSettingsForRunConfiguration(null, runSettingsXml));
        }