Skip to content

Commit

Permalink
Set ConfigSource of default holder to "Default" instead of "AppConfig"
Browse files Browse the repository at this point in the history
  • Loading branch information
gasparnagy committed Oct 10, 2017
1 parent c34b5fc commit fb1717e
Showing 1 changed file with 40 additions and 39 deletions.
@@ -1,40 +1,41 @@
using System;
using System.Xml;
using TechTalk.SpecFlow.Configuration;

namespace TechTalk.SpecFlow.Generator.Interfaces
{
/// IMPORTANT
/// This class is used for interop with the Visual Studio Extension
/// DO NOT REMOVE OR RENAME FIELDS!
/// This breaks binary serialization accross appdomains
[Serializable]
public class SpecFlowConfigurationHolder : ISpecFlowConfigurationHolder
{
private readonly string xmlString;

public ConfigSource ConfigSource { get; private set; }

public string Content => xmlString;

public bool HasConfiguration => !string.IsNullOrEmpty(xmlString);

public SpecFlowConfigurationHolder()
{
xmlString = null;
}

public SpecFlowConfigurationHolder(ConfigSource configSource, string content)
{
ConfigSource = configSource;
xmlString = content;
}

public SpecFlowConfigurationHolder(XmlNode configXmlNode)
{
xmlString = configXmlNode?.OuterXml;
ConfigSource = ConfigSource.AppConfig;
}
}

using System;
using System.Xml;
using TechTalk.SpecFlow.Configuration;

namespace TechTalk.SpecFlow.Generator.Interfaces
{
/// IMPORTANT
/// This class is used for interop with the Visual Studio Extension
/// DO NOT REMOVE OR RENAME FIELDS!
/// This breaks binary serialization accross appdomains
[Serializable]
public class SpecFlowConfigurationHolder : ISpecFlowConfigurationHolder
{
private readonly string xmlString;

public ConfigSource ConfigSource { get; }

public string Content => xmlString;

public bool HasConfiguration => !string.IsNullOrEmpty(xmlString);

public SpecFlowConfigurationHolder()
{
ConfigSource = ConfigSource.Default;
xmlString = null;
}

public SpecFlowConfigurationHolder(ConfigSource configSource, string content)
{
ConfigSource = configSource;
xmlString = content;
}

public SpecFlowConfigurationHolder(XmlNode configXmlNode)
{
xmlString = configXmlNode?.OuterXml;
ConfigSource = ConfigSource.AppConfig;
}
}

}

0 comments on commit fb1717e

Please sign in to comment.