-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor ConfigurationFactory to HoconConfigurationFactory to prevent name collision * Refactor GetArray() to return a more generic IList<T> instead * Add Hocon.API.Test project * Make sure the approval text files aree copied to the output directory * Exclude Hocon.API.Tests from linux build because Linux does not like ApiApprover * Downgrade Hocon.API.Tests target framework to net461
- Loading branch information
Showing
29 changed files
with
1,156 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net461</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
|
||
<RootNamespace>Hocon.API.Tests</RootNamespace> | ||
|
||
<AssemblyName>Hocon.API.Tests</AssemblyName> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="HoconAPISpec.ApproveConfiguration.approved.txt" /> | ||
<None Remove="HoconAPISpec.ApproveCore.approved.txt" /> | ||
<None Remove="HoconAPISpec.ApproveExtensionConfiguration.approved.txt" /> | ||
<None Remove="HoconAPISpec.ApproveImmutable.approved.txt" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="HoconAPISpec.ApproveConfiguration.approved.txt"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="HoconAPISpec.ApproveCore.approved.txt"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="HoconAPISpec.ApproveExtensionConfiguration.approved.txt"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="HoconAPISpec.ApproveImmutable.approved.txt"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="ApiApprover" Version="9.3.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Hocon.Configuration\Hocon.Configuration.csproj" /> | ||
<ProjectReference Include="..\Hocon.Extensions.Configuration\Hocon.Extensions.Configuration.csproj" /> | ||
<ProjectReference Include="..\Hocon.Immutable\Hocon.Immutable.csproj" /> | ||
<ProjectReference Include="..\Hocon\Hocon.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
83 changes: 83 additions & 0 deletions
83
src/Hocon.API.Tests/HoconAPISpec.ApproveConfiguration.approved.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName=".NET Framework 4.6.1")] | ||
namespace Hocon | ||
{ | ||
public abstract class CDataConfigurationElement : System.Configuration.ConfigurationElement | ||
{ | ||
protected const string ContentPropertyName = "content"; | ||
protected CDataConfigurationElement() { } | ||
protected override void DeserializeElement(System.Xml.XmlReader reader, bool serializeCollectionKey) { } | ||
} | ||
public class Config : Hocon.HoconRoot, System.IEquatable<Hocon.Config>, System.Runtime.Serialization.ISerializable | ||
{ | ||
protected Hocon.HoconValue _mergedValueCache; | ||
[System.ObsoleteAttribute("For json serialization/deserialization only", true)] | ||
protected Config() { } | ||
protected Config(Hocon.HoconValue value) { } | ||
protected Config(Hocon.HoconValue value, Hocon.Config fallback) { } | ||
public Config(Hocon.HoconRoot root) { } | ||
public Config(Hocon.HoconRoot root, Hocon.Config fallback) { } | ||
[System.ObsoleteAttribute("Used for serialization only", true)] | ||
public Config(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } | ||
public static Hocon.Config Empty { get; } | ||
public virtual System.Collections.Generic.IReadOnlyList<Hocon.HoconValue> Fallbacks { get; } | ||
public virtual bool IsEmpty { get; } | ||
public Hocon.HoconValue Root { get; } | ||
protected System.Collections.Generic.List<Hocon.HoconValue> _fallbacks { get; } | ||
public override System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Hocon.HoconField>> AsEnumerable() { } | ||
public virtual bool Equals(Hocon.Config other) { } | ||
public override bool Equals(object obj) { } | ||
public virtual Hocon.Config GetConfig(string path) { } | ||
public virtual Hocon.Config GetConfig(Hocon.HoconPath path) { } | ||
protected override Hocon.HoconValue GetNode(Hocon.HoconPath path) { } | ||
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } | ||
public string ToString(bool useFallbackValues) { } | ||
protected override bool TryGetNode(Hocon.HoconPath path, out Hocon.HoconValue result) { } | ||
public virtual Hocon.Config WithFallback(Hocon.Config fallback) { } | ||
public static Hocon.Config +(Hocon.Config config, string fallback) { } | ||
public static Hocon.Config +(string configHocon, Hocon.Config fallbackConfig) { } | ||
public static Hocon.Config op_Implicit(string str) { } | ||
} | ||
public class static ConfigExtensions | ||
{ | ||
public static bool IsNullOrEmpty(this Hocon.Config config) { } | ||
public static Hocon.Config SafeWithFallback(this Hocon.Config config, Hocon.Config fallback) { } | ||
} | ||
public class ConfigurationException : System.Exception | ||
{ | ||
public ConfigurationException(string message) { } | ||
public ConfigurationException(string message, System.Exception exception) { } | ||
protected ConfigurationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } | ||
public static Hocon.ConfigurationException NullOrEmptyConfig<T>(string path = null) { } | ||
} | ||
public class static DebuggingExtensions | ||
{ | ||
public static string DumpConfig(this Hocon.Config c, bool dumpAsFallbacks = True) { } | ||
} | ||
public class HoconConfigurationElement : Hocon.CDataConfigurationElement | ||
{ | ||
public HoconConfigurationElement() { } | ||
[System.Configuration.ConfigurationPropertyAttribute("content", IsKey=true, IsRequired=true)] | ||
public string Content { get; set; } | ||
} | ||
public class static HoconConfigurationFactory | ||
{ | ||
public static Hocon.Config Empty { get; } | ||
public static Hocon.Config Default() { } | ||
public static Hocon.Config FromFile(string filePath) { } | ||
public static Hocon.Config FromResource(string resourceName, object instanceInAssembly) { } | ||
public static Hocon.Config FromResource<TAssembly>(string resourceName) { } | ||
public static Hocon.Config FromResource(string resourceName, System.Reflection.Assembly assembly) { } | ||
[System.ObsoleteAttribute("Call the ConfigurationFactory.Default method instead.")] | ||
public static Hocon.Config Load() { } | ||
public static Hocon.Config Load(string sectionName) { } | ||
public static Hocon.Config ParseString(string hocon, Hocon.HoconIncludeCallbackAsync includeCallback) { } | ||
public static Hocon.Config ParseString(string hocon) { } | ||
} | ||
public class HoconConfigurationSection : System.Configuration.ConfigurationSection | ||
{ | ||
public HoconConfigurationSection() { } | ||
public Hocon.Config Config { get; } | ||
[System.Configuration.ConfigurationPropertyAttribute("hocon", IsRequired=true)] | ||
public Hocon.HoconConfigurationElement Hocon { get; set; } | ||
} | ||
} |
Oops, something went wrong.