forked from growthbook/growthbook-c-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:Inforitnl/growthbook-c-sharp into f…
…eature/automated-github-builds-test-and-deploy
- Loading branch information
Showing
16 changed files
with
248 additions
and
103 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
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 |
---|---|---|
@@ -1,80 +1,41 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" /> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{649FDBB7-2442-4DF5-B493-401D2ECF527D}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Test</RootNamespace> | ||
<AssemblyName>Test</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> | ||
<IsCodedUITest>False</IsCodedUITest> | ||
<TestProjectType>UnitTest</TestProjectType> | ||
<NuGetPackageImportStamp> | ||
</NuGetPackageImportStamp> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<TargetFramework>net6</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="Json\custom-cases.json" /> | ||
<None Remove="Json\FeatureDictionary.json" /> | ||
<None Remove="Json\GrowthBookContext.json" /> | ||
<None Remove="Json\GrowthBookContext.NoFeatures.json" /> | ||
<None Remove="Json\SingleFeatureDictionary.WithNameSpace..json" /> | ||
<None Remove="Json\standard-cases.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<EmbeddedResource Include="Json\custom-cases.json" /> | ||
<EmbeddedResource Include="Json\FeatureDictionary.json" /> | ||
<EmbeddedResource Include="Json\GrowthBookContext.json" /> | ||
<EmbeddedResource Include="Json\GrowthBookContext.NoFeatures.json" /> | ||
<EmbeddedResource Include="Json\SingleFeatureDictionary.WithNameSpace..json" /> | ||
<EmbeddedResource Include="Json\standard-cases.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="GrowthBookTests.cs" /> | ||
<Compile Include="Utilities.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<PackageReference Include="MSTest" Version="3.1.1" /> | ||
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" /> | ||
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="custom-cases.json" /> | ||
<None Include="standard-cases.json" /> | ||
<None Include="packages.config" /> | ||
<ProjectReference Include="..\GrowthBook\GrowthBook.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\GrowthBook\GrowthBook.csproj"> | ||
<Project>{eb2e6969-d39e-4093-b267-826226de50dc}</Project> | ||
<Name>GrowthBook</Name> | ||
</ProjectReference> | ||
<Folder Include="Properties\" /> | ||
</ItemGroup> | ||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
<PropertyGroup> | ||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | ||
</PropertyGroup> | ||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props'))" /> | ||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets'))" /> | ||
</Target> | ||
<Import Project="..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" /> | ||
</Project> | ||
|
||
</Project> |
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,39 @@ | ||
{ | ||
"backend_test1": { | ||
"DefaultValue": [], | ||
"Rules": [] | ||
}, | ||
"backend_test2": { | ||
"DefaultValue": [], | ||
"Rules": [] | ||
}, | ||
"backend_test3": { | ||
"DefaultValue": [], | ||
"Rules": [ | ||
{ | ||
"Condition": { | ||
"tenantName": [] | ||
}, | ||
"Coverage": 1, | ||
"Force": [], | ||
"Variations": null, | ||
"Key": null, | ||
"Weights": null, | ||
"Namespace": null, | ||
"HashAttribute": "id" | ||
}, | ||
{ | ||
"Condition": { | ||
"tenantName": [] | ||
}, | ||
"Coverage": 1, | ||
"Force": [], | ||
"Variations": null, | ||
"Key": null, | ||
"Weights": null, | ||
"Namespace": null, | ||
"HashAttribute": "id" | ||
} | ||
] | ||
} | ||
} |
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,11 @@ | ||
{ | ||
"EnvironmentName": "Dev", | ||
"Enabled": true, | ||
"Attributes": {}, | ||
"Url": null, | ||
"Features": { | ||
}, | ||
"ForcedVariations": {}, | ||
"QaMode": false, | ||
"TrackingCallback": null | ||
} |
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,48 @@ | ||
{ | ||
"EnvironmentName": "Dev", | ||
"Enabled": true, | ||
"Attributes": {}, | ||
"Url": null, | ||
"Features": { | ||
"backend_test1": { | ||
"DefaultValue": [], | ||
"Rules": [] | ||
}, | ||
"backend_test2": { | ||
"DefaultValue": [], | ||
"Rules": [] | ||
}, | ||
"backend_test3": { | ||
"DefaultValue": [], | ||
"Rules": [ | ||
{ | ||
"Condition": { | ||
"tenantName": [] | ||
}, | ||
"Coverage": 1, | ||
"Force": [], | ||
"Variations": null, | ||
"Key": null, | ||
"Weights": null, | ||
"Namespace": null, | ||
"HashAttribute": "id" | ||
}, | ||
{ | ||
"Condition": { | ||
"tenantName": [] | ||
}, | ||
"Coverage": 1, | ||
"Force": [], | ||
"Variations": null, | ||
"Key": null, | ||
"Weights": null, | ||
"Namespace": null, | ||
"HashAttribute": "id" | ||
} | ||
] | ||
} | ||
}, | ||
"ForcedVariations": {}, | ||
"QaMode": false, | ||
"TrackingCallback": null | ||
} |
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,33 @@ | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
|
||
namespace Growthbook.Tests.Json; | ||
|
||
public static class JsonTestHelpers | ||
{ | ||
public static string GetTestJson(string jsonName) | ||
{ | ||
return GetTestJson( | ||
Assembly.GetExecutingAssembly(), | ||
$"{typeof(JsonTestHelpers).Namespace}/{jsonName}.json"); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the contents of the embedded resource as a string. | ||
/// </summary> | ||
public static string GetTestJson(Assembly assembly, string resourceName) | ||
{ | ||
using Stream stream = assembly.GetManifestResourceStream(resourceName.Replace('/', '.')); | ||
|
||
if (stream == null) | ||
{ | ||
throw new InvalidOperationException($"The resource {resourceName} is not available - make sure that it has Build Action set to Embedded Resource"); | ||
} | ||
|
||
using StreamReader reader = new StreamReader(stream); | ||
|
||
var json = reader.ReadToEnd(); | ||
return json; | ||
} | ||
} |
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,19 @@ | ||
{ | ||
"backend_test3": { | ||
"DefaultValue": [], | ||
"Rules": [ | ||
{ | ||
"Condition": { | ||
"tenantName": [] | ||
}, | ||
"Coverage": 1, | ||
"Force": [], | ||
"Variations": null, | ||
"Key": null, | ||
"Weights": null, | ||
"Namespace": null, | ||
"HashAttribute": "id" | ||
} | ||
] | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.