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.
- Loading branch information
1 parent
8a24e63
commit 179b5fa
Showing
16 changed files
with
261 additions
and
245 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,51 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
</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> | ||
<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> | ||
<PackageReference Include="FluentAssertions" Version="6.5.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.10" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" /> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="XunitXml.TestLogger" Version="3.0.70" /> | ||
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="test-results/" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../GrowthBook/GrowthBook.csproj" /> | ||
</ItemGroup> | ||
|
||
</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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 16 additions & 10 deletions
26
Test/NamespaceTupleConverterTests.cs → ...ook.Tests/NamespaceTupleConverterTests.cs
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,45 +1,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using GrowthBook; | ||
using Growthbook.Tests.Json; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
using GrowthBook.Tests.Json; | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace Test | ||
using Xunit; | ||
|
||
namespace GrowthBook.Tests | ||
{ | ||
[TestClass] | ||
public class NamespaceTupleConverterTests | ||
{ | ||
[TestMethod] | ||
[Fact] | ||
public void CreateFromJson_NoFeatures_ShouldSucceed() | ||
{ | ||
string json = JsonTestHelpers.GetTestJson("GrowthBookContext.NoFeatures"); | ||
|
||
var gb = JsonConvert.DeserializeObject<Context>(json); | ||
} | ||
|
||
[TestMethod] | ||
[Fact] | ||
public void CreateFromJson_WithFeatures_ShouldSucceed() | ||
{ | ||
string json = JsonTestHelpers.GetTestJson("GrowthBookContext"); | ||
|
||
var gb = JsonConvert.DeserializeObject<Context>(json); | ||
} | ||
|
||
[TestMethod] | ||
[Fact] | ||
public void CreateFeaturesFromJson_WithFeatures_ShouldSucceed() | ||
{ | ||
string json = JsonTestHelpers.GetTestJson("FeatureDictionary"); | ||
|
||
var gb = JsonConvert.DeserializeObject<Dictionary<string, Feature>>(json); | ||
} | ||
|
||
[TestMethod] | ||
[Fact] | ||
public void CreateFeaturesFromJson_OneFeatureWithNameSpace_ShouldSucceed() | ||
{ | ||
string json = JsonTestHelpers.GetTestJson("SingleFeatureDictionary.WithNameSpace."); | ||
string json = JsonTestHelpers.GetTestJson("SingleFeatureDictionary.WithNameSpace"); | ||
|
||
var gb = JsonConvert.DeserializeObject<Dictionary<string, Feature>>(json); | ||
} | ||
|
||
|
||
} | ||
|
||
} |
Oops, something went wrong.