├── src ├── NFeature │ ├── keypair.snk │ ├── packages.config │ ├── NFeature.nuspec │ ├── FeatureVisibilityMode.cs │ ├── IApplicationClock.cs │ ├── ITenancyContext.cs │ ├── EmptyArgs.cs │ ├── FeatureSettingNameAttribute.cs │ ├── Exceptions │ │ ├── CircularFeatureSettingDependencyException.cs │ │ ├── FeatureDependencyConfigurationException.cs │ │ ├── FeatureNotAvailableException.cs │ │ ├── FeatureNotConfiguredException.cs │ │ ├── EstablishedFeatureAvailabilityCheckException.cs │ │ └── EstablishedFeatureDependencyException.cs │ ├── FeatureManifest.cs │ ├── IFeatureManifestService.cs │ ├── DefaultImplementations │ │ ├── DefaultApplicationClock.cs │ │ ├── ManifestCreationStrategyDefault`1.cs │ │ ├── ApplicationClockWithOffset.cs │ │ ├── ApplicationClockWithOffsetFactory.cs │ │ ├── DefaultFunctions.cs │ │ ├── ManifestCreationStrategyDefault`2.cs │ │ └── ManifestCreationStrategyConsideringStateCookieTenantAndTime.cs │ ├── IFeatureManifest.cs │ ├── FeatureSettingAvailabilityChecker`1.cs │ ├── FeatureSettingAvailabilityChecker`2.cs │ ├── IFeatureDescriptor.cs │ ├── FeatureManifestService.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── FeatureSettingExtensions.cs │ ├── IFeatureSettingService.cs │ ├── FeatureDescriptor.cs │ ├── IFeatureSettingAvailabilityChecker.cs │ ├── FeatureSettingService`1.cs │ ├── FeatureSettingService`2.cs │ ├── FeatureSettingService`3.cs │ ├── IFeatureManifestCreationStrategy.cs │ ├── FeatureSettingAvailabilityChecker`3.cs │ ├── FeatureEnumExtensions.cs │ └── NFeature.csproj ├── packages │ ├── Moq.4.0.10827 │ │ ├── Moq.chm │ │ ├── lib │ │ │ ├── NET35 │ │ │ │ ├── Moq.dll │ │ │ │ └── Moq.pdb │ │ │ ├── NET40 │ │ │ │ ├── Moq.dll │ │ │ │ └── Moq.pdb │ │ │ └── Silverlight4 │ │ │ │ ├── Castle.Core.dll │ │ │ │ ├── Moq.Silverlight.dll │ │ │ │ └── Moq.Silverlight.pdb │ │ ├── Moq.4.0.10827.nupkg │ │ └── License.txt │ ├── NUnit.2.6.0.12054 │ │ ├── license.txt │ │ ├── NUnit.2.6.0.12054.nupkg │ │ └── lib │ │ │ └── nunit.framework.dll │ ├── NUnit.Runners.2.6.0.12051 │ │ ├── Logo.ico │ │ ├── tools │ │ │ ├── runpnunit.bat │ │ │ ├── agent.conf │ │ │ ├── nunit.exe │ │ │ ├── lib │ │ │ │ ├── log4net.dll │ │ │ │ ├── nunit.core.dll │ │ │ │ ├── nunit.uikit.dll │ │ │ │ ├── nunit.util.dll │ │ │ │ ├── nunit-gui-runner.dll │ │ │ │ ├── nunit.uiexception.dll │ │ │ │ ├── nunit-console-runner.dll │ │ │ │ ├── nunit.core.interfaces.dll │ │ │ │ └── Images │ │ │ │ │ └── Tree │ │ │ │ │ ├── Circles │ │ │ │ │ ├── Failure.jpg │ │ │ │ │ ├── Ignored.jpg │ │ │ │ │ ├── Skipped.jpg │ │ │ │ │ ├── Success.jpg │ │ │ │ │ └── Inconclusive.jpg │ │ │ │ │ ├── Classic │ │ │ │ │ ├── Failure.jpg │ │ │ │ │ ├── Ignored.jpg │ │ │ │ │ ├── Skipped.jpg │ │ │ │ │ ├── Success.jpg │ │ │ │ │ └── Inconclusive.jpg │ │ │ │ │ ├── Default │ │ │ │ │ ├── Failure.png │ │ │ │ │ ├── Ignored.png │ │ │ │ │ ├── Skipped.png │ │ │ │ │ ├── Success.png │ │ │ │ │ └── Inconclusive.png │ │ │ │ │ └── Visual Studio │ │ │ │ │ ├── Failure.png │ │ │ │ │ ├── Ignored.png │ │ │ │ │ ├── Skipped.png │ │ │ │ │ ├── Success.png │ │ │ │ │ ├── Inconclusive.png │ │ │ │ │ └── SeriousWarning.png │ │ │ ├── nunit-agent.exe │ │ │ ├── nunit-x86.exe │ │ │ ├── nunit-console.exe │ │ │ ├── nunit-editor.exe │ │ │ ├── pnunit-agent.exe │ │ │ ├── pnunit.tests.dll │ │ │ ├── nunit-agent-x86.exe │ │ │ ├── nunit.framework.dll │ │ │ ├── pnunit-launcher.exe │ │ │ ├── pnunit.framework.dll │ │ │ ├── nunit-console-x86.exe │ │ │ ├── nunit-x86.exe.config │ │ │ ├── nunit.exe.config │ │ │ ├── nunit-console-x86.exe.config │ │ │ ├── nunit-console.exe.config │ │ │ ├── nunit-agent-x86.exe.config │ │ │ ├── nunit-agent.exe.config │ │ │ ├── test.conf │ │ │ ├── pnunit-agent.exe.config │ │ │ └── pnunit-launcher.exe.config │ │ ├── license.txt │ │ └── NUnit.Runners.2.6.0.12051.nupkg │ ├── NSure.1.0.4554.34428 │ │ ├── lib │ │ │ └── net40 │ │ │ │ └── NSure.dll │ │ └── NSure.1.0.4554.34428.nupkg │ ├── Newtonsoft.Json.4.5.7 │ │ ├── Newtonsoft.Json.4.5.7.nupkg │ │ └── lib │ │ │ ├── sl4 │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── net20 │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── net35 │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── net40 │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── sl3-wp │ │ │ └── Newtonsoft.Json.dll │ │ │ ├── winrt45 │ │ │ └── Newtonsoft.Json.dll │ │ │ └── sl4-windowsphone71 │ │ │ └── Newtonsoft.Json.dll │ ├── NHelpfulException.1.0.4554.34109 │ │ ├── lib │ │ │ └── net40 │ │ │ │ └── NHelpfulException.dll │ │ └── NHelpfulException.1.0.4554.34109.nupkg │ ├── NBasicExtensionMethod.1.0.4554.34582 │ │ ├── lib │ │ │ └── net40 │ │ │ │ └── NBasicExtensionMethod.dll │ │ └── NBasicExtensionMethod.1.0.4554.34582.nupkg │ ├── NFeature.Configuration.1.0.4554.36639 │ │ ├── lib │ │ │ └── net40 │ │ │ │ └── NFeature.Configuration.dll │ │ └── NFeature.Configuration.1.0.4554.36639.nupkg │ └── repositories.config ├── NFeature.Example.Console │ ├── packages.config │ ├── NFeature.Example.Console.sln │ ├── app.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Program.cs │ └── NFeature.Example.Console.csproj ├── NFeature.Test.Slow │ ├── packages.config │ ├── Tenant.cs │ ├── Feature.cs │ ├── FeatureSettingNames.cs │ ├── App.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── FeatureEnumExtensionsTests.cs │ └── NFeature.Test.Slow.csproj ├── NFeature.DefaultTenant.Test.Slow │ ├── packages.config │ ├── Feature.cs │ ├── FeatureSettingNames.cs │ ├── App.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── FeatureEnumExtensionsTests.cs │ └── NFeature.DefaultTenant.Test.Slow.csproj ├── NFeature.Test.Fast │ ├── packages.config │ ├── Tenant.cs │ ├── Feature.cs │ ├── FeatureSettingNames.cs │ ├── FeatureConfigurationTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── FeatureExtensionsTests.cs │ └── NFeature.Test.Fast.csproj ├── clean.bat └── NFeature.sln ├── .gitignore ├── readme.md └── COPYING.LESSER /src/NFeature/keypair.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/NFeature/keypair.snk -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/Moq.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Moq.4.0.10827/Moq.chm -------------------------------------------------------------------------------- /src/packages/NUnit.2.6.0.12054/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.2.6.0.12054/license.txt -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/lib/NET35/Moq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Moq.4.0.10827/lib/NET35/Moq.dll -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/lib/NET35/Moq.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Moq.4.0.10827/lib/NET35/Moq.pdb -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/lib/NET40/Moq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Moq.4.0.10827/lib/NET40/Moq.dll -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/lib/NET40/Moq.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Moq.4.0.10827/lib/NET40/Moq.pdb -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/Moq.4.0.10827.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Moq.4.0.10827/Moq.4.0.10827.nupkg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/Logo.ico -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/runpnunit.bat: -------------------------------------------------------------------------------- 1 | start pnunit-agent 8080 . 2 | start pnunit-agent 8081 . 3 | pnunit-launcher test.conf 4 | -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/license.txt -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/agent.conf: -------------------------------------------------------------------------------- 1 | 2 | 8080 3 | . 4 | -------------------------------------------------------------------------------- /src/packages/NSure.1.0.4554.34428/lib/net40/NSure.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NSure.1.0.4554.34428/lib/net40/NSure.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.6.0.12054/NUnit.2.6.0.12054.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.2.6.0.12054/NUnit.2.6.0.12054.nupkg -------------------------------------------------------------------------------- /src/packages/NUnit.2.6.0.12054/lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.2.6.0.12054/lib/nunit.framework.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/nunit.exe -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/lib/Silverlight4/Castle.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Moq.4.0.10827/lib/Silverlight4/Castle.Core.dll -------------------------------------------------------------------------------- /src/packages/NSure.1.0.4554.34428/NSure.1.0.4554.34428.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NSure.1.0.4554.34428/NSure.1.0.4554.34428.nupkg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/log4net.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-agent.exe -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-x86.exe -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-console.exe -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-editor.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-editor.exe -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit-agent.exe -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit.tests.dll -------------------------------------------------------------------------------- /src/packages/Newtonsoft.Json.4.5.7/Newtonsoft.Json.4.5.7.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Newtonsoft.Json.4.5.7/Newtonsoft.Json.4.5.7.nupkg -------------------------------------------------------------------------------- /src/packages/Newtonsoft.Json.4.5.7/lib/sl4/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Newtonsoft.Json.4.5.7/lib/sl4/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.dll -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Moq.4.0.10827/lib/Silverlight4/Moq.Silverlight.pdb -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.core.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.uikit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.uikit.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.util.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.util.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-agent-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-agent-x86.exe -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/nunit.framework.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit-launcher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit-launcher.exe -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit.framework.dll -------------------------------------------------------------------------------- /src/packages/Newtonsoft.Json.4.5.7/lib/net20/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Newtonsoft.Json.4.5.7/lib/net20/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /src/packages/Newtonsoft.Json.4.5.7/lib/net35/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Newtonsoft.Json.4.5.7/lib/net35/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /src/packages/Newtonsoft.Json.4.5.7/lib/net40/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Newtonsoft.Json.4.5.7/lib/net40/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /src/packages/Newtonsoft.Json.4.5.7/lib/sl3-wp/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Newtonsoft.Json.4.5.7/lib/sl3-wp/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-console-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-console-x86.exe -------------------------------------------------------------------------------- /src/packages/Newtonsoft.Json.4.5.7/lib/winrt45/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Newtonsoft.Json.4.5.7/lib/winrt45/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/NUnit.Runners.2.6.0.12051.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/NUnit.Runners.2.6.0.12051.nupkg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit-gui-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit-gui-runner.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.uiexception.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.uiexception.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit-console-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit-console-runner.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.core.interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/nunit.core.interfaces.dll -------------------------------------------------------------------------------- /src/packages/NHelpfulException.1.0.4554.34109/lib/net40/NHelpfulException.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NHelpfulException.1.0.4554.34109/lib/net40/NHelpfulException.dll -------------------------------------------------------------------------------- /src/packages/Newtonsoft.Json.4.5.7/lib/sl4-windowsphone71/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/Newtonsoft.Json.4.5.7/lib/sl4-windowsphone71/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Failure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Failure.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Ignored.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Ignored.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Skipped.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Skipped.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Success.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Success.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Failure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Failure.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Ignored.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Ignored.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Skipped.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Skipped.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Success.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Success.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Failure.png -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Ignored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Ignored.png -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Skipped.png -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Success.png -------------------------------------------------------------------------------- /src/packages/NBasicExtensionMethod.1.0.4554.34582/lib/net40/NBasicExtensionMethod.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NBasicExtensionMethod.1.0.4554.34582/lib/net40/NBasicExtensionMethod.dll -------------------------------------------------------------------------------- /src/packages/NHelpfulException.1.0.4554.34109/NHelpfulException.1.0.4554.34109.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NHelpfulException.1.0.4554.34109/NHelpfulException.1.0.4554.34109.nupkg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Inconclusive.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Circles/Inconclusive.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Inconclusive.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Classic/Inconclusive.jpg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Inconclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Default/Inconclusive.png -------------------------------------------------------------------------------- /src/packages/NFeature.Configuration.1.0.4554.36639/lib/net40/NFeature.Configuration.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NFeature.Configuration.1.0.4554.36639/lib/net40/NFeature.Configuration.dll -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Failure.png -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Ignored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Ignored.png -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Skipped.png -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Success.png -------------------------------------------------------------------------------- /src/packages/NBasicExtensionMethod.1.0.4554.34582/NBasicExtensionMethod.1.0.4554.34582.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NBasicExtensionMethod.1.0.4554.34582/NBasicExtensionMethod.1.0.4554.34582.nupkg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Inconclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/Inconclusive.png -------------------------------------------------------------------------------- /src/packages/NFeature.Configuration.1.0.4554.36639/NFeature.Configuration.1.0.4554.36639.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NFeature.Configuration.1.0.4554.36639/NFeature.Configuration.1.0.4554.36639.nupkg -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/SeriousWarning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benaston/NFeature/HEAD/src/packages/NUnit.Runners.2.6.0.12051/tools/lib/Images/Tree/Visual Studio/SeriousWarning.png -------------------------------------------------------------------------------- /src/NFeature.Example.Console/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # VS Bits 2 | [Oo]bj 3 | [bB]in 4 | *.suo 5 | Publish.xml 6 | 7 | # ReSharper 8 | _ReSharper.* 9 | *.user 10 | 11 | # Runtime/Misc Junk :) 12 | *.log* 13 | .sass-cache 14 | .orig 15 | 16 | # SASS-Generated Files 17 | 18 | 19 | # Project Build Output 20 | 21 | #Mac and vim files 22 | *.swp 23 | .DS_Store 24 | Thumbs.db 25 | 26 | #Misc 27 | TestResult.xml -------------------------------------------------------------------------------- /src/NFeature.Test.Slow/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/NFeature/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/NFeature.DefaultTenant.Test.Slow/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/packages/repositories.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/NFeature.Test.Fast/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/clean.bat: -------------------------------------------------------------------------------- 1 | cd /d %0\.. 2 | FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin') DO RMDIR /S /Q "%%G" 3 | FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%%G" 4 | FOR /F "tokens=*" %%G IN ('DIR /B /AD /S _ReSharper.*') DO RMDIR /S /Q "%%G" 5 | FOR /F "tokens=*" %%G IN ('DIR /B /S *.csproj.user') DO del "%%G" 6 | FOR /F "tokens=*" %%G IN ('DIR /B /A /S *.suo') DO del "%%G" 7 | FOR /F "tokens=*" %%G IN ('DIR /B /S *.ReSharper.user') DO del "%%G" 8 | FOR /F "tokens=*" %%G IN ('DIR /B /S TestResult.xml') DO del "%%G" 9 | FOR /F "tokens=*" %%G IN ('DIR /B /S *.sln.cache') DO del "%%G" -------------------------------------------------------------------------------- /src/NFeature/NFeature.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $id$ 5 | $version$ 6 | $title$ 7 | $author$ 8 | $author$ 9 | http://www.gnu.org/licenses/lgpl.txt 10 | https://github.com/benaston/NFeature 11 | https://secure.gravatar.com/avatar/2a43432a33175c6bbe896da22dd6f6ee?s=140 12 | false 13 | $description$ 14 | Copyright 2011 15 | feature,feature-configuration-wall,feature-wall,configuration 16 | 17 | -------------------------------------------------------------------------------- /src/NFeature/FeatureVisibilityMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | public enum FeatureVisibilityMode 21 | { 22 | Normal, 23 | Preview, 24 | } 25 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Fast/Tenant.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Test.Fast 19 | { 20 | public enum Tenant 21 | { 22 | All = 0, 23 | TenantA, 24 | TenantB, 25 | } 26 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Slow/Tenant.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Test.Slow 19 | { 20 | public enum Tenant 21 | { 22 | All = 0, 23 | TenantA, 24 | TenantB, 25 | } 26 | } -------------------------------------------------------------------------------- /src/NFeature/IApplicationClock.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System; 21 | 22 | public interface IApplicationClock 23 | { 24 | DateTime Now { get; } 25 | } 26 | } -------------------------------------------------------------------------------- /src/NFeature.Example.Console/NFeature.Example.Console.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NFeature.Example.Console", "NFeature.Example.Console.csproj", "{F20A8857-26F2-4212-9663-91C8823942BE}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {F20A8857-26F2-4212-9663-91C8823942BE}.Debug|x86.ActiveCfg = Debug|x86 13 | {F20A8857-26F2-4212-9663-91C8823942BE}.Debug|x86.Build.0 = Debug|x86 14 | {F20A8857-26F2-4212-9663-91C8823942BE}.Release|x86.ActiveCfg = Release|x86 15 | {F20A8857-26F2-4212-9663-91C8823942BE}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /src/NFeature/ITenancyContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | public interface ITenancyContext 21 | where TTenant : struct 22 | { 23 | TTenant CurrentTenant { get; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Fast/Feature.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Test.Fast 19 | { 20 | public enum Feature 21 | { 22 | TestFeatureA = 1, 23 | TestFeatureB, 24 | TestFeatureC, 25 | TestFeatureD, 26 | TestFeatureE, 27 | TestFeatureF, 28 | } 29 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Slow/Feature.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Test.Slow 19 | { 20 | public enum Feature 21 | { 22 | TestFeatureA = 1, 23 | TestFeatureB, 24 | TestFeatureC, 25 | TestFeatureD, 26 | TestFeatureE, 27 | TestFeatureF, 28 | } 29 | } -------------------------------------------------------------------------------- /src/NFeature/EmptyArgs.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | /// 21 | /// Used as a placeholder type when no arguments need to be passed to the FeatureSettingAvailabilityChecker. 22 | /// 23 | public class EmptyArgs {} 24 | } -------------------------------------------------------------------------------- /src/NFeature/FeatureSettingNameAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System; 21 | 22 | [AttributeUsage(AttributeTargets.Field)] 23 | public class FeatureSettingAttribute : Attribute 24 | { 25 | public string FullName { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /src/NFeature.DefaultTenant.Test.Slow/Feature.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultTenant.Test.Slow 19 | { 20 | public enum Feature 21 | { 22 | TestFeatureA = 1, 23 | TestFeatureB, 24 | TestFeatureC, 25 | TestFeatureD, 26 | TestFeatureE, 27 | TestFeatureF, 28 | } 29 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Fast/FeatureSettingNames.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Test.Fast 19 | { 20 | public static class FeatureSettingNames 21 | { 22 | #region TestFeature1 enum 23 | 24 | public enum TestFeature1 25 | { 26 | ExampleSettingName, 27 | } 28 | 29 | #endregion 30 | } 31 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Slow/FeatureSettingNames.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Test.Slow 19 | { 20 | public static class FeatureSettingNames 21 | { 22 | #region TestFeatureE enum 23 | 24 | public enum TestFeatureE 25 | { 26 | [FeatureSetting(FullName = "My.Type, MyAssembly")] AssemblyName, 27 | SimpleSetting, 28 | } 29 | 30 | #endregion 31 | } 32 | } -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/NFeature/Exceptions/CircularFeatureSettingDependencyException.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Exceptions 19 | { 20 | using System; 21 | 22 | /// 23 | /// Indicates that a feature depends ultimately upon itself being available, which is an invalid dependency. 24 | /// 25 | public class CircularFeatureSettingDependencyException : Exception {} 26 | } -------------------------------------------------------------------------------- /src/NFeature/FeatureManifest.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System.Collections.Generic; 21 | 22 | /// 23 | /// See notes on iface. 24 | /// 25 | public class FeatureManifest : 26 | Dictionary>, IFeatureManifest 27 | where TFeatureEnum : struct {} 28 | } -------------------------------------------------------------------------------- /src/NFeature.DefaultTenant.Test.Slow/FeatureSettingNames.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultTenant.Test.Slow 19 | { 20 | public static class FeatureSettingNames 21 | { 22 | #region TestFeatureE enum 23 | 24 | public enum TestFeatureE 25 | { 26 | [FeatureSetting(FullName = "My.Type, MyAssembly")] AssemblyName, 27 | SimpleSetting, 28 | } 29 | 30 | #endregion 31 | } 32 | } -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-console-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-console.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/NFeature/Exceptions/FeatureDependencyConfigurationException.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Exceptions 19 | { 20 | using System; 21 | using NHelpfulException; 22 | 23 | public class FeatureDependencyConfigurationException : HelpfulException 24 | { 25 | public FeatureDependencyConfigurationException(string message, Exception innerException) 26 | : base(message, innerException: innerException) {} 27 | } 28 | } -------------------------------------------------------------------------------- /src/NFeature/IFeatureManifestService.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | /// 21 | /// Responsible for encapsulating functionality related to FeatureManifests that makes more sense to be placed on a service type. 22 | /// 23 | public interface IFeatureManifestService 24 | where TFeatureEnum : struct 25 | { 26 | IFeatureManifest GetManifest(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/NFeature/DefaultImplementations/DefaultApplicationClock.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultImplementations 19 | { 20 | using System; 21 | 22 | /// 23 | /// Default implementation of the application clock. Your own implementation might implement an offset feature (see ApplicationClockWithOffset type), depending on user-set locale. 24 | /// 25 | public class ApplicationClock : IApplicationClock 26 | { 27 | public DateTime Now { 28 | get { return DateTime.Now; } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /src/NFeature/IFeatureManifest.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System.Collections.Generic; 21 | 22 | /// 23 | /// Responsible for encapsulating a record of all the features in the application together with their availability. 24 | /// 25 | /// The enumeration type used to define the features in the system. 26 | public interface IFeatureManifest : 27 | IDictionary> 28 | where TFeatureEnum : struct {} 29 | } -------------------------------------------------------------------------------- /src/NFeature/Exceptions/FeatureNotAvailableException.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Exceptions 19 | { 20 | using System; 21 | using NHelpfulException; 22 | 23 | public class FeatureNotAvailableException : HelpfulException 24 | { 25 | public FeatureNotAvailableException(string problemDescription, 26 | string[] resolutionSuggestions = default(string[]), 27 | Exception innerException = default(Exception)) 28 | : base(problemDescription, resolutionSuggestions, innerException) {} 29 | } 30 | } -------------------------------------------------------------------------------- /src/NFeature/Exceptions/FeatureNotConfiguredException.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Exceptions 19 | { 20 | using System; 21 | using NHelpfulException; 22 | 23 | public class FeatureNotConfiguredException : HelpfulException 24 | where TFeatureEnum : struct 25 | { 26 | public FeatureNotConfiguredException(TFeatureEnum feature, Exception innerException) 27 | : base( 28 | string.Format("Feature configuration not found for \"{0}\".", 29 | Enum.GetName(typeof (TFeatureEnum), feature)), 30 | innerException: innerException) {} 31 | } 32 | } -------------------------------------------------------------------------------- /src/NFeature/FeatureSettingAvailabilityChecker`1.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System; 21 | using Configuration; 22 | 23 | public class FeatureSettingAvailabilityChecker : 24 | FeatureSettingAvailabilityChecker, 25 | IFeatureSettingAvailabilityChecker 26 | where TFeatureEnum : struct 27 | { 28 | public FeatureSettingAvailabilityChecker( 29 | Func, EmptyArgs, bool> 30 | availabilityCheckFunction) 31 | : base(availabilityCheckFunction) {} 32 | } 33 | } -------------------------------------------------------------------------------- /src/NFeature/FeatureSettingAvailabilityChecker`2.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System; 21 | using Configuration; 22 | 23 | public class FeatureSettingAvailabilityChecker : 24 | FeatureSettingAvailabilityChecker 25 | where TFeatureEnum : struct 26 | { 27 | public FeatureSettingAvailabilityChecker( 28 | Func, TAvailabilityCheckArgs, bool> 29 | availabilityCheckFunction) 30 | : base(availabilityCheckFunction) {} 31 | } 32 | } -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-agent-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/nunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/NFeature/DefaultImplementations/ManifestCreationStrategyDefault`1.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultImplementations 19 | { 20 | using Configuration; 21 | 22 | public class ManifestCreationStrategyDefault : 23 | ManifestCreationStrategyDefault 24 | where TFeatureEnum : struct 25 | { 26 | public ManifestCreationStrategyDefault( 27 | IFeatureSettingRepository featureSettingRepository, 28 | IFeatureSettingService featureSettingService) 29 | : base(featureSettingRepository, featureSettingService) {} 30 | } 31 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Fast/FeatureConfigurationTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Test.Fast 19 | { 20 | using NUnit.Framework; 21 | 22 | [TestFixture] 23 | [Category("Fast")] 24 | public class FeatureConfigurationTests 25 | { 26 | [Test] 27 | public void IsEnabledInFeatureManifest_ReturnsTrue_WhenFeatureIsAvailable() { 28 | var m = new FeatureManifest { 29 | { 30 | Feature.TestFeatureA, 31 | new FeatureDescriptor(Feature.TestFeatureA) 32 | {IsAvailable = true,} 33 | } 34 | }; 35 | 36 | Assert.That(Feature.TestFeatureA.IsAvailable(m)); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/NFeature.Example.Console/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/NFeature.Test.Slow/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
7 | 8 | 9 | 10 | 12 | 13 | 15 | 16 | 18 | 19 | 21 | 22 | 24 | 25 | -------------------------------------------------------------------------------- /src/NFeature.DefaultTenant.Test.Slow/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 22 | 23 | 28 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /src/NFeature/IFeatureDescriptor.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System.Collections.Generic; 21 | 22 | /// 23 | /// A description of the state of a feature. Metadata for members of the Feature enumeration. 24 | /// 25 | public interface IFeatureDescriptor 26 | { 27 | /// 28 | /// Calculated by the manifest creation strategy. Might be based on feature dependencies and cookies, for example. 29 | /// 30 | bool IsAvailable { get; set; } 31 | 32 | IList Dependencies { get; set; } 33 | 34 | IDictionary Settings { get; set; } 35 | } 36 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Fast/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | using System.Reflection; 19 | using System.Runtime.InteropServices; 20 | 21 | [assembly: AssemblyTitle("NFeature.Test.Fast")] 22 | [assembly: 23 | AssemblyDescription( 24 | "Fast tests for NFeature main assembly.")] 25 | [assembly: AssemblyConfiguration("")] 26 | [assembly: AssemblyCompany("Ben Aston")] 27 | [assembly: AssemblyProduct("NFeature")] 28 | [assembly: AssemblyCopyright("Copyright © Ben Aston")] 29 | [assembly: AssemblyTrademark("")] 30 | [assembly: AssemblyCulture("")] 31 | [assembly: ComVisible(false)] 32 | [assembly: Guid("434ad64e-9a27-4f06-ae41-3d4007fa70c9")] 33 | [assembly: AssemblyVersion("1.0.*")] -------------------------------------------------------------------------------- /src/NFeature.Example.Console/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | using System.Reflection; 19 | using System.Runtime.InteropServices; 20 | 21 | [assembly: AssemblyTitle("NFeature.Example.Console")] 22 | [assembly: 23 | AssemblyDescription( 24 | "Example console application using NFeature.")] 25 | [assembly: AssemblyConfiguration("")] 26 | [assembly: AssemblyCompany("Ben Aston")] 27 | [assembly: AssemblyProduct("NFeature")] 28 | [assembly: AssemblyCopyright("Copyright © Ben Aston")] 29 | [assembly: AssemblyTrademark("")] 30 | [assembly: AssemblyCulture("")] 31 | [assembly: ComVisible(false)] 32 | [assembly: Guid("c83bba95-f771-4aba-a71d-7c11b88e6ca3")] 33 | [assembly: AssemblyVersion("1.0.*")] -------------------------------------------------------------------------------- /src/NFeature/FeatureManifestService.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | public class FeatureManifestService : IFeatureManifestService 21 | where TFeatureEnum : struct 22 | { 23 | private readonly IFeatureManifestCreationStrategy _manifestCreationStrategy; 24 | 25 | public FeatureManifestService( 26 | IFeatureManifestCreationStrategy manifestCreationStrategy) { 27 | _manifestCreationStrategy = manifestCreationStrategy; 28 | } 29 | 30 | /// 31 | /// Uses the supplied strategy to retrieve the FeatureManifest. 32 | /// 33 | public IFeatureManifest GetManifest() { 34 | return _manifestCreationStrategy.CreateFeatureManifest(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/NFeature/Exceptions/EstablishedFeatureAvailabilityCheckException.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Exceptions 19 | { 20 | using NHelpfulException; 21 | 22 | public class EstablishedFeatureAvailabilityCheckException : HelpfulException 23 | where TFeature : struct 24 | { 25 | private const string DefaultProblemDescription = 26 | @"Feature '{0}' is established and may not be queried for availability."; 27 | 28 | private static readonly string[] ResolutionSuggestions = new[] { 29 | "Check feature configuration." 30 | , 31 | "Remove availability check." 32 | }; 33 | 34 | public EstablishedFeatureAvailabilityCheckException(TFeature f) 35 | : base(string.Format(DefaultProblemDescription, f), ResolutionSuggestions, null) {} 36 | } 37 | } -------------------------------------------------------------------------------- /src/NFeature/Exceptions/EstablishedFeatureDependencyException.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Exceptions 19 | { 20 | using NHelpfulException; 21 | 22 | public class EstablishedFeatureDependencyException : HelpfulException 23 | where TFeature : struct 24 | { 25 | private const string DefaultProblemDescription = 26 | @"Dependencies of established features must be established themselves. Established feature '{0}' depends upon non-established feature '{1}'."; 27 | 28 | private static readonly string[] ResolutionSuggestions = new[] { 29 | "Check feature configuration." 30 | , 31 | }; 32 | 33 | public EstablishedFeatureDependencyException(TFeature feature, TFeature dependency) 34 | : base( 35 | string.Format(DefaultProblemDescription, feature, dependency), ResolutionSuggestions, null) {} 36 | } 37 | } -------------------------------------------------------------------------------- /src/NFeature/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | using System.Reflection; 19 | using System.Runtime.InteropServices; 20 | 21 | [assembly: AssemblyTitle("NFeature")] 22 | [assembly: 23 | AssemblyDescription( 24 | "Simple feature configuration and availability-control for .NET. Please help me to improve the quality of NFeature by reporting issues on GitHub at https://github.com/benaston/NFeature/issues, or emailing ben@bj.ma." 25 | )] 26 | [assembly: AssemblyConfiguration("")] 27 | [assembly: AssemblyCompany("Ben Aston")] 28 | [assembly: AssemblyProduct("NFeature")] 29 | [assembly: AssemblyCopyright("Copyright © Ben Aston")] 30 | [assembly: AssemblyTrademark("")] 31 | [assembly: AssemblyCulture("")] 32 | [assembly: ComVisible(false)] 33 | [assembly: Guid("72a96dd5-a055-465b-a252-f0e0af75c2e5")] 34 | [assembly: AssemblyVersion("1.0.*")] -------------------------------------------------------------------------------- /src/NFeature/DefaultImplementations/ApplicationClockWithOffset.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultImplementations 19 | { 20 | using System; 21 | 22 | /// 23 | /// An implementation of a clock with an offset. Can be used to enable testing of features that will only be available at some time in the future (because it enables simulation of travelling into the future). 24 | /// 25 | public class ApplicationClockWithOffset : IApplicationClock 26 | { 27 | public ApplicationClockWithOffset() { 28 | SystemOffset = TimeSpan.Zero; 29 | } 30 | 31 | public ApplicationClockWithOffset(TimeSpan systemOffset) { 32 | SystemOffset = systemOffset; 33 | } 34 | 35 | public TimeSpan SystemOffset { get; private set; } 36 | 37 | public DateTime Now { 38 | get { return DateTime.Now.Add(SystemOffset); } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/NFeature/FeatureSettingExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System; 21 | using System.Linq; 22 | using Configuration; 23 | 24 | public static class FeatureSettingExtensions 25 | { 26 | public static bool IsAvailable( 27 | this FeatureSetting f, 28 | FeatureVisibilityMode m, 29 | TTenantEnum tenant, 30 | DateTime currentDtg) 31 | where TFeatureEnum : struct 32 | where TTenantEnum : struct { 33 | return (f.SupportedTenants.Contains((TTenantEnum) Enum.ToObject(typeof (TTenantEnum), 0)) || 34 | f.SupportedTenants.Contains(tenant)) && 35 | (f.FeatureState == FeatureState.Enabled || 36 | (f.FeatureState == FeatureState.Previewable && m == FeatureVisibilityMode.Preview)) && 37 | f.StartDtg <= currentDtg && 38 | f.EndDtg > currentDtg; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/NFeature/IFeatureSettingService.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using Configuration; 21 | 22 | public interface IFeatureSettingService : 23 | IFeatureSettingService 24 | where TFeatureEnum : struct {} 25 | 26 | /// 27 | /// Responsible for encapsulating functionality related to FeatureSetting that makes more sense to be placed on a service type. 28 | /// 29 | public interface IFeatureSettingService 30 | where TFeatureEnum : struct 31 | where TTenantEnum : struct 32 | { 33 | /// 34 | /// Determines whether the dependencies are satisfied for the specified feature setting. 35 | /// 36 | bool AllDependenciesAreSatisfiedForTheFeatureSetting( 37 | FeatureSetting f, 38 | TAvailabilityCheckArgs availabilityCheckArgs); 39 | } 40 | } -------------------------------------------------------------------------------- /src/NFeature/FeatureDescriptor.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System.Collections.Generic; 21 | using Exceptions; 22 | 23 | /// 24 | /// See comments on iface. 25 | /// 26 | public class FeatureDescriptor : IFeatureDescriptor 27 | where TFeatureEnum : struct 28 | { 29 | private bool _isAvailable; 30 | 31 | public FeatureDescriptor(TFeatureEnum feature) { 32 | Feature = feature; 33 | } 34 | 35 | public TFeatureEnum Feature { get; set; } 36 | 37 | public bool IsEstablished { get; set; } 38 | 39 | public bool IsAvailable { 40 | get { 41 | if (IsEstablished) { 42 | throw new EstablishedFeatureAvailabilityCheckException(Feature); 43 | } 44 | 45 | return _isAvailable; 46 | } 47 | set { _isAvailable = value; } 48 | } 49 | 50 | public IList Dependencies { get; set; } 51 | 52 | public IDictionary Settings { get; set; } 53 | } 54 | } -------------------------------------------------------------------------------- /src/packages/Moq.4.0.10827/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007. Clarius Consulting, Manas Technology Solutions, InSTEDD 2 | http://code.google.com/p/moq/ 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, 6 | with or without modification, are permitted provided 7 | that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the 10 | above copyright notice, this list of conditions and 11 | the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce 14 | the above copyright notice, this list of conditions 15 | and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | * Neither the name of Clarius Consulting, Manas Technology Solutions or InSTEDD nor the 19 | names of its contributors may be used to endorse 20 | or promote products derived from this software 21 | without specific prior written permission. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 24 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 25 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 26 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 28 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 30 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 33 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 | SUCH DAMAGE. 37 | 38 | [This is the BSD license, see 39 | http://www.opensource.org/licenses/bsd-license.php] -------------------------------------------------------------------------------- /src/NFeature/IFeatureSettingAvailabilityChecker.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System.Collections.Generic; 21 | using Configuration; 22 | 23 | public interface IFeatureSettingAvailabilityChecker : 24 | IFeatureSettingAvailabilityChecker 25 | where TFeatureEnum : struct {} 26 | 27 | public interface IFeatureSettingAvailabilityChecker : 28 | IFeatureSettingAvailabilityChecker 29 | where TFeatureEnum : struct {} 30 | 31 | public interface IFeatureSettingAvailabilityChecker 33 | where TFeatureEnum : struct 34 | where TTenant : struct 35 | { 36 | bool RecursivelyCheckAvailability( 37 | FeatureSetting featureSettingToCheck, 38 | FeatureSetting[] allFeatureSettings, 39 | TAvailabilityCheckArgs availabilityCheckTuple = 40 | default(TAvailabilityCheckArgs), 41 | List> featuresCurrentlyUnderAnalysis = 42 | null); 43 | } 44 | } -------------------------------------------------------------------------------- /src/NFeature/DefaultImplementations/ApplicationClockWithOffsetFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultImplementations 19 | { 20 | using System; 21 | using System.Globalization; 22 | using System.Web; 23 | 24 | /// 25 | /// Can be used to instantiate an instance of ApplicationClockWithOffset. Checks the querystring and if it matches the requirement for performing an offset, applies it to the clock. 26 | /// 27 | public static class ApplicationClockWithOffsetFactory 28 | { 29 | public static ApplicationClockWithOffset CreateFromQueryString(string queryStringFieldName, 30 | string 31 | expectedQueryStringFormat, 32 | string dtgCultureIdentifier) { 33 | TimeSpan offset = TimeSpan.Zero; 34 | string queryStringOffset = HttpContext.Current.Request.QueryString[queryStringFieldName]; 35 | if (queryStringOffset != null) { 36 | offset = TimeSpan.ParseExact(queryStringOffset, 37 | expectedQueryStringFormat, 38 | new CultureInfo(dtgCultureIdentifier), 39 | TimeSpanStyles.None); 40 | } 41 | 42 | return new ApplicationClockWithOffset(offset); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/NFeature/FeatureSettingService`1.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using Configuration; 21 | 22 | public class FeatureSettingService : IFeatureSettingService 23 | where TFeatureEnum : struct 24 | 25 | { 26 | private readonly IFeatureSettingAvailabilityChecker 27 | _featureSettingAvailabilityChecker; 28 | 29 | private readonly IFeatureSettingRepository 30 | _featureSettingRepository; 31 | 32 | public FeatureSettingService( 33 | IFeatureSettingAvailabilityChecker featureSettingAvailabilityChecker, 34 | IFeatureSettingRepository featureSettingRepository) { 35 | _featureSettingAvailabilityChecker = featureSettingAvailabilityChecker; 36 | _featureSettingRepository = featureSettingRepository; 37 | } 38 | 39 | public bool AllDependenciesAreSatisfiedForTheFeatureSetting( 40 | FeatureSetting f, 41 | EmptyArgs availabilityCheckArgs) { 42 | return _featureSettingAvailabilityChecker.RecursivelyCheckAvailability(f, 43 | _featureSettingRepository 44 | .GetFeatureSettings(), 45 | availabilityCheckArgs); 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Slow/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | using System.Reflection; 19 | using System.Runtime.InteropServices; 20 | 21 | // General Information about an assembly is controlled through the following 22 | // set of attributes. Change these attribute values to modify the information 23 | // associated with an assembly. 24 | 25 | [assembly: AssemblyTitle("NFeature.Test.Slow")] 26 | [assembly: AssemblyDescription("")] 27 | [assembly: AssemblyConfiguration("")] 28 | [assembly: AssemblyCompany("Microsoft")] 29 | [assembly: AssemblyProduct("NFeature.Test.Slow")] 30 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 31 | [assembly: AssemblyTrademark("")] 32 | [assembly: AssemblyCulture("")] 33 | 34 | // Setting ComVisible to false makes the types in this assembly not visible 35 | // to COM components. If you need to access a type in this assembly from 36 | // COM, set the ComVisible attribute to true on that type. 37 | 38 | [assembly: ComVisible(false)] 39 | 40 | // The following GUID is for the ID of the typelib if this project is exposed to COM 41 | 42 | [assembly: Guid("8fd2a2d7-71ab-4412-a17a-e5863f131c6c")] 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | 55 | [assembly: AssemblyVersion("1.0.0.0")] 56 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /src/NFeature/FeatureSettingService`2.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using Configuration; 21 | 22 | public class FeatureSettingService : 23 | IFeatureSettingService 24 | where TFeatureEnum : struct 25 | { 26 | private readonly 27 | IFeatureSettingAvailabilityChecker 28 | _featureSettingAvailabilityChecker; 29 | 30 | private readonly IFeatureSettingRepository 31 | _featureSettingRepository; 32 | 33 | public FeatureSettingService( 34 | IFeatureSettingAvailabilityChecker 35 | featureSettingAvailabilityChecker, 36 | IFeatureSettingRepository featureSettingRepository) { 37 | _featureSettingAvailabilityChecker = featureSettingAvailabilityChecker; 38 | _featureSettingRepository = featureSettingRepository; 39 | } 40 | 41 | public bool AllDependenciesAreSatisfiedForTheFeatureSetting( 42 | FeatureSetting f, 43 | TAvailabilityCheckArgs availabilityCheckArgs) { 44 | return _featureSettingAvailabilityChecker.RecursivelyCheckAvailability(f, 45 | _featureSettingRepository 46 | .GetFeatureSettings(), 47 | availabilityCheckArgs); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /src/NFeature/FeatureSettingService`3.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using Configuration; 21 | 22 | public class FeatureSettingService : 23 | IFeatureSettingService 24 | where TFeatureEnum : struct 25 | where TTenantEnum : struct 26 | { 27 | private readonly 28 | IFeatureSettingAvailabilityChecker 29 | _featureSettingAvailabilityChecker; 30 | 31 | private readonly IFeatureSettingRepository 32 | _featureSettingRepository; 33 | 34 | public FeatureSettingService( 35 | IFeatureSettingAvailabilityChecker 36 | featureSettingAvailabilityChecker, 37 | IFeatureSettingRepository featureSettingRepository) { 38 | _featureSettingAvailabilityChecker = featureSettingAvailabilityChecker; 39 | _featureSettingRepository = featureSettingRepository; 40 | } 41 | 42 | public bool AllDependenciesAreSatisfiedForTheFeatureSetting( 43 | FeatureSetting f, 44 | TAvailabilityCheckArgs availabilityCheckArgs) { 45 | return _featureSettingAvailabilityChecker.RecursivelyCheckAvailability(f, 46 | _featureSettingRepository 47 | .GetFeatureSettings(), 48 | availabilityCheckArgs); 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /src/NFeature.DefaultTenant.Test.Slow/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | using System.Reflection; 19 | using System.Runtime.InteropServices; 20 | 21 | // General Information about an assembly is controlled through the following 22 | // set of attributes. Change these attribute values to modify the information 23 | // associated with an assembly. 24 | 25 | [assembly: AssemblyTitle("NFeature.DefaultTenant.Test.Slow")] 26 | [assembly: AssemblyDescription("")] 27 | [assembly: AssemblyConfiguration("")] 28 | [assembly: AssemblyCompany("Microsoft")] 29 | [assembly: AssemblyProduct("NFeature.DefaultTenant.Test.Slow")] 30 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")] 31 | [assembly: AssemblyTrademark("")] 32 | [assembly: AssemblyCulture("")] 33 | 34 | // Setting ComVisible to false makes the types in this assembly not visible 35 | // to COM components. If you need to access a type in this assembly from 36 | // COM, set the ComVisible attribute to true on that type. 37 | 38 | [assembly: ComVisible(false)] 39 | 40 | // The following GUID is for the ID of the typelib if this project is exposed to COM 41 | 42 | [assembly: Guid("2c6deab6-20dd-487a-81c2-8ff0193eb430")] 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | 55 | [assembly: AssemblyVersion("1.0.0.0")] 56 | [assembly: AssemblyFileVersion("1.0.0.0")] -------------------------------------------------------------------------------- /src/NFeature/DefaultImplementations/DefaultFunctions.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultImplementations 19 | { 20 | using System; 21 | using System.Linq; 22 | using Configuration; 23 | 24 | public static class DefaultFunctions 25 | { 26 | public static bool AvailabilityCheckFunction( 27 | FeatureSetting s, 28 | Tuple args) 29 | where TFeatureEnum : struct { 30 | return ((s.FeatureState == FeatureState.Enabled || 31 | (s.FeatureState == FeatureState.Previewable && 32 | args.Item1 == FeatureVisibilityMode.Preview)) && 33 | s.StartDtg <= args.Item2 && 34 | s.EndDtg > args.Item2); 35 | } 36 | 37 | /// 38 | /// The default implementation of the availability checker. Checks the tenancy, feature state and date/time. Can of course be substituted for by your own function. For example, your own function might take into consideration a number indicating site load or user role. 39 | /// 40 | public static bool AvailabilityCheckFunction( 41 | FeatureSetting s, 42 | Tuple args) 43 | where TFeatureEnum : struct 44 | where TTenantEnum : struct { 45 | return 46 | (s.SupportedTenants.Contains((TTenantEnum) Enum.ToObject(typeof (TTenantEnum), 0)) || 47 | s.SupportedTenants.Contains(args.Item2)) && 48 | (s.FeatureState == FeatureState.Enabled || 49 | (s.FeatureState == FeatureState.Previewable && args.Item1 == FeatureVisibilityMode.Preview)) && 50 | s.StartDtg <= args.Item3 && 51 | s.EndDtg > args.Item3; 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /src/NFeature/IFeatureManifestCreationStrategy.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | /// 21 | /// Responsible for defining the interface for types that provide functionality for feature manifest creation. These strategies might for example, take into account cookie configuration, domain configuration and user role. 22 | /// 23 | /// 24 | /// Suggested implementation is to inject the FeatureSettingService and FeatureSetttingRepository via the constructor along with whatever other services you need to determine availability. 25 | /// 26 | /// 27 | /// CreateFeatureManifest() 29 | /// { 30 | /// var featureSettings = _featureSettingRepository.GetFeatureSettings(); 31 | /// var manifest = new FeatureManifest(); 32 | /// 33 | /// foreach (var setting in featureSettings) 34 | /// { 35 | /// var isAvailable = _featureSettingService 36 | /// .AllDependenciesAreSatisfiedForTheFeatureSetting(setting, new EmptyArgs()); 37 | /// 38 | /// manifest.Add(setting.Feature, 39 | /// new FeatureDescriptor(setting.Feature) 40 | /// { 41 | /// Dependencies = setting.Dependencies, 42 | /// IsAvailable = isAvailable, 43 | /// Settings = setting.Settings, 44 | /// }); 45 | /// } 46 | /// 47 | /// return manifest; 48 | /// } 49 | /// ]]> 50 | /// 51 | public interface IFeatureManifestCreationStrategy 52 | where TFeatureEnum : struct 53 | { 54 | IFeatureManifest CreateFeatureManifest(); 55 | } 56 | } -------------------------------------------------------------------------------- /src/NFeature/DefaultImplementations/ManifestCreationStrategyDefault`2.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultImplementations 19 | { 20 | using Configuration; 21 | 22 | public class ManifestCreationStrategyDefault : 23 | IFeatureManifestCreationStrategy 24 | where TFeatureEnum : struct 25 | where TTenantEnum : struct 26 | { 27 | private readonly IFeatureSettingRepository _featureSettingRepository; 28 | private readonly IFeatureSettingService _featureSettingService; 29 | 30 | public ManifestCreationStrategyDefault( 31 | IFeatureSettingRepository featureSettingRepository, 32 | IFeatureSettingService featureSettingService) { 33 | _featureSettingRepository = featureSettingRepository; 34 | _featureSettingService = featureSettingService; 35 | } 36 | 37 | public IFeatureManifest CreateFeatureManifest() { 38 | FeatureSetting[] featureSettings = _featureSettingRepository.GetFeatureSettings(); 39 | var manifest = new FeatureManifest(); 40 | 41 | foreach (var setting in featureSettings) { 42 | var isAvailable = _featureSettingService.AllDependenciesAreSatisfiedForTheFeatureSetting(setting, new EmptyArgs()); 43 | 44 | manifest.Add(setting.Feature, 45 | new FeatureDescriptor(setting.Feature) { 46 | Dependencies = 47 | setting.Dependencies, 48 | IsAvailable = 49 | isAvailable, 50 | Settings = 51 | setting.Settings, 52 | }); 53 | } 54 | 55 | return manifest; 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/test.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Testing 12 | 13 | 14 | Testing 15 | pnunit.tests.dll 16 | TestLibraries.Testing.EqualTo19 17 | $agent_host:8080 18 | 19 | 20 | 21 | 22 | 23 | 24 | Parallel_Tests 25 | 26 | 27 | ParallelTest_A_Test 28 | pnunit.tests.dll 29 | TestLibraries.ParallelExample.ParallelTest_A 30 | $agent_host:8080 31 | 32 | 33 | 2 34 | 35 | 36 | 37 | ParallelTest_B_Test 38 | pnunit.tests.dll 39 | TestLibraries.ParallelExample.ParallelTest_B 40 | $agent_host:8080 41 | 42 | 1 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Parallel_Barriers 52 | 53 | 54 | Parallel_Barriers_TestA 55 | pnunit.tests.dll 56 | TestLibraries.ParallelExampleWithBarriers.ParallelTestWithBarriersA 57 | $agent_host:8080 58 | 59 | 60 | 61 | START_BARRIER 62 | WAIT_BARRIER 63 | 64 | 65 | 66 | Parallel_Barriers_TestB 67 | pnunit.tests.dll 68 | TestLibraries.ParallelExampleWithBarriers.ParallelTestWithBarriersB 69 | $agent_host:8081 70 | 71 | 72 | 73 | START_BARRIER 74 | WAIT_BARRIER 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/packages/NUnit.Runners.2.6.0.12051/tools/pnunit-launcher.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/NFeature.DefaultTenant.Test.Slow/FeatureEnumExtensionsTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultTenant.Test.Slow 19 | { 20 | using System; 21 | using Configuration; 22 | using DefaultImplementations; 23 | using NUnit.Framework; 24 | 25 | [TestFixture] 26 | [Category("Slow")] 27 | public class FeatureEnumExtensionsTests 28 | { 29 | #region Setup/Teardown 30 | 31 | [SetUp] 32 | public void Setup() { 33 | var availabilityChecker = 34 | new FeatureSettingAvailabilityChecker(MyAvailabilityCheckFunction); 35 | var featureSettingRepo = new AppConfigFeatureSettingRepository(); 36 | var featureSettingService = 37 | new FeatureSettingService(availabilityChecker, featureSettingRepo); 38 | var manifestCreationStrategy = 39 | new ManifestCreationStrategyDefault(featureSettingRepo, featureSettingService); 40 | var featureManifestService = new FeatureManifestService(manifestCreationStrategy); 41 | _featureManifest = featureManifestService.GetManifest(); 42 | } 43 | 44 | #endregion 45 | 46 | private IFeatureManifest _featureManifest; 47 | 48 | /// 49 | /// A function to test the availability checking behavior. 50 | /// 51 | private static bool MyAvailabilityCheckFunction(FeatureSetting s, 52 | EmptyArgs args) { 53 | return Enum.GetName(typeof (Feature), s.Feature) == "TestFeatureE"; 54 | } 55 | 56 | [Test] 57 | public void IsAvailable_WhenTheAvailabilityCheckingFunctionReturnsFalse_ReturnsFalse() { 58 | Assert.That(!Feature.TestFeatureA.IsAvailable(_featureManifest)); 59 | Assert.That(!Feature.TestFeatureB.IsAvailable(_featureManifest)); 60 | Assert.That(!Feature.TestFeatureC.IsAvailable(_featureManifest)); 61 | Assert.That(!Feature.TestFeatureD.IsAvailable(_featureManifest)); 62 | } 63 | 64 | [Test] 65 | public void 66 | IsAvailable_WhenTheAvailabilityCheckingFunctionReturnsTrueAndDependenciesAreOK_ReturnsTrue() { 67 | Assert.That(Feature.TestFeatureE.IsAvailable(_featureManifest)); 68 | } 69 | 70 | [Test] 71 | public void Setting_WithFullName_RetrievedOK() { 72 | Assert.That( 73 | Feature.TestFeatureE.Setting(FeatureSettingNames.TestFeatureE.AssemblyName, 74 | _featureManifest) == "testFeatureSetting1Value"); 75 | } 76 | 77 | [Test] 78 | public void Setting_WithoutFullName_RetrievedOK() { 79 | Assert.That( 80 | Feature.TestFeatureE.Setting(FeatureSettingNames.TestFeatureE.SimpleSetting, 81 | _featureManifest) == "testFeatureSetting2Value"); 82 | } 83 | } 84 | } 85 | 86 | // ReSharper restore InconsistentNaming -------------------------------------------------------------------------------- /src/NFeature.Test.Slow/FeatureEnumExtensionsTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Test.Slow 19 | { 20 | using System; 21 | using Configuration; 22 | using DefaultImplementations; 23 | using NUnit.Framework; 24 | 25 | [TestFixture] 26 | [Category("Slow")] 27 | public class FeatureEnumExtensionsTests 28 | { 29 | #region Setup/Teardown 30 | 31 | [SetUp] 32 | public void Setup() { 33 | var availabilityChecker = 34 | new FeatureSettingAvailabilityChecker( 35 | MyAvailabilityCheckFunction); 36 | var featureSettingRepo = new AppConfigFeatureSettingRepository(); 37 | var featureSettingService = 38 | new FeatureSettingService(availabilityChecker, 39 | featureSettingRepo); 40 | var manifestCreationStrategy = 41 | new ManifestCreationStrategyDefault(featureSettingRepo, 42 | featureSettingService); 43 | var featureManifestService = new FeatureManifestService(manifestCreationStrategy); 44 | _featureManifest = featureManifestService.GetManifest(); 45 | } 46 | 47 | #endregion 48 | 49 | private IFeatureManifest _featureManifest; 50 | 51 | /// 52 | /// A function to test the availability checking behavior. 53 | /// 54 | private static bool MyAvailabilityCheckFunction(FeatureSetting s, 55 | EmptyArgs args) { 56 | return Enum.GetName(typeof (Feature), s.Feature) == "TestFeatureE"; 57 | } 58 | 59 | [Test] 60 | public void IsAvailable_WhenTheAvailabilityCheckingFunctionReturnsFalse_ReturnsFalse() { 61 | Assert.That(!Feature.TestFeatureA.IsAvailable(_featureManifest)); 62 | Assert.That(!Feature.TestFeatureB.IsAvailable(_featureManifest)); 63 | Assert.That(!Feature.TestFeatureC.IsAvailable(_featureManifest)); 64 | Assert.That(!Feature.TestFeatureD.IsAvailable(_featureManifest)); 65 | } 66 | 67 | [Test] 68 | public void 69 | IsAvailable_WhenTheAvailabilityCheckingFunctionReturnsTrueAndDependenciesAreOK_ReturnsTrue() { 70 | Assert.That(Feature.TestFeatureE.IsAvailable(_featureManifest)); 71 | } 72 | 73 | [Test] 74 | public void Setting_WithFullName_RetrievedOK() { 75 | Assert.That( 76 | Feature.TestFeatureE.Setting(FeatureSettingNames.TestFeatureE.AssemblyName, 77 | _featureManifest) == 78 | "testFeatureSetting1Value"); 79 | } 80 | 81 | [Test] 82 | public void Setting_WithoutFullName_RetrievedOK() { 83 | Assert.That( 84 | Feature.TestFeatureE.Setting(FeatureSettingNames.TestFeatureE.SimpleSetting, 85 | _featureManifest) == 86 | "testFeatureSetting2Value"); 87 | } 88 | } 89 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Fast/FeatureExtensionsTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Test.Fast 19 | { 20 | using System.Collections.Generic; 21 | using Exceptions; 22 | using NUnit.Framework; 23 | 24 | [TestFixture] 25 | [Category("Fast")] 26 | public class FeatureExtensionsTests 27 | { 28 | [Test] 29 | public void 30 | IsAvailable_WhenInvokedAgainstAnEstablishedFeature_ThrowsAnException_BecauseEstablishedFeaturesCannotBeAnythingOtherThanEnabled 31 | () { 32 | //arrange 33 | const string desiredSettingValue = "test@example.com"; 34 | var featureManifest = new FeatureManifest { 35 | { 36 | Feature.TestFeatureA, 37 | new FeatureDescriptor( 38 | Feature.TestFeatureA) { 39 | IsEstablished = 40 | true, 41 | Settings = 42 | new Dictionary 43 | { 45 | { 46 | "ExampleSettingName" 47 | , 48 | desiredSettingValue 49 | } 50 | } 51 | } 52 | } 53 | }; 54 | 55 | //act / assert 56 | Assert.Throws 57 | > 58 | (() => Feature.TestFeatureA.IsAvailable(featureManifest)); 59 | } 60 | 61 | [Test] 62 | public void Setting_WhenInvokedAgainstFeatureNotAvailable_ThrowsException() { 63 | //arrange 64 | var featureManifest = new FeatureManifest { 65 | { 66 | Feature.TestFeatureA, 67 | new FeatureDescriptor( 68 | Feature.TestFeatureA) { 69 | IsAvailable = 70 | false, 71 | Settings = 72 | new Dictionary 73 | { 75 | { 76 | "SettingName" 77 | , 78 | "SettingValue" 79 | } 80 | } 81 | } 82 | } 83 | }; 84 | 85 | //assert 86 | Assert.Throws(() => Feature.TestFeatureA.Setting( 87 | FeatureSettingNames.TestFeature1.ExampleSettingName, featureManifest)); 88 | } 89 | 90 | [Test] 91 | public void Setting_WhenInvoked_ReturnsTheValueAssociatedWithThatSetting() { 92 | //arrange 93 | const string desiredSettingValue = "test@example.com"; 94 | var featureManifest = new FeatureManifest { 95 | { 96 | Feature.TestFeatureE, 97 | new FeatureDescriptor( 98 | Feature.TestFeatureE) { 99 | IsAvailable = 100 | true, 101 | Settings = 102 | new Dictionary 103 | { 105 | { 106 | "ExampleSettingName" 107 | , 108 | desiredSettingValue 109 | } 110 | } 111 | } 112 | } 113 | }; 114 | 115 | //act 116 | dynamic actualSettingValue = 117 | Feature.TestFeatureE.Setting( 118 | FeatureSettingNames.TestFeature1.ExampleSettingName, featureManifest); 119 | 120 | //assert 121 | Assert.That(actualSettingValue == desiredSettingValue); 122 | } 123 | } 124 | } -------------------------------------------------------------------------------- /src/NFeature.Example.Console/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.Example.Console 19 | { 20 | using System; 21 | using Configuration; 22 | using DefaultImplementations; 23 | using Exceptions; 24 | 25 | //0. Get it (ensure the Nuget reference in this solution is up-to-date) 26 | 27 | //1. Define some features 28 | public enum Feature 29 | { 30 | MyFeature, 31 | MyOtherFeature, 32 | MyOtherOtherFeature, 33 | } 34 | 35 | public enum MyFeatureSettings 36 | { 37 | mySetting, 38 | } 39 | 40 | /// 41 | /// Demonstration of NFeature basics. Uses the default availability check function, and some minimal settings in the app.config to demonstrate the checking of feature availability and the reading of a feature setting. 42 | /// 43 | internal class Program 44 | { 45 | private static void Main(string[] a) { 46 | //2. Define the availability-checking function 47 | Func, EmptyArgs, bool> fn = 48 | (f, args) => 49 | DefaultFunctions.AvailabilityCheckFunction(f, 50 | Tuple.Create(FeatureVisibilityMode.Normal, 51 | DateTime.Now)); 52 | 53 | //3. Take care of feature manifest initialization 54 | //NOTE: I suggest hiding this ugly initialization logic away in the IOC container configuration 55 | var featureSettingRepo = new AppConfigFeatureSettingRepository(); 56 | var availabilityChecker = new FeatureSettingAvailabilityChecker(fn); 57 | //from step 2 58 | var featureSettingService = 59 | new FeatureSettingService(availabilityChecker, 60 | featureSettingRepo); 61 | var manifestCreationStrategy = 62 | new ManifestCreationStrategyDefault(featureSettingRepo, 63 | featureSettingService); 64 | //we use the default for this example 65 | var featureManifestService = new FeatureManifestService(manifestCreationStrategy); 66 | var featureManifest = featureManifestService.GetManifest(); 67 | 68 | //4. Configure feature dependencies (see the web.config - we do not specify any dependencies for this demo) 69 | 70 | //5. Add code that is conditional on feature availability. featureManifest ideally supplied via IOC container 71 | if (Feature.MyFeature.IsAvailable(featureManifest)) { 72 | Console.WriteLine("MyFeature is available."); 73 | } else { 74 | throw new FeatureNotAvailableException( 75 | "MyFeature is not available. This is unexpected behavior for the default implementation of NFeature.Example.Console.", 76 | new[] { 77 | "Check your app.config.", "Ensure built DLLs are up to date.", 78 | "Ensure you have not modified this application or its configuration." 79 | }); 80 | } 81 | 82 | //6. Optionally configure feature-specific settings using JSON 83 | Console.WriteLine(Feature.MyFeature.Setting(MyFeatureSettings.mySetting, featureManifest)); 84 | Console.ReadLine(); 85 | 86 | //7. Optionally specify dates for feature availability 87 | 88 | //8. At some future date optionally mark your feature as 89 | //Established to indicate that it is now integral to your 90 | //application and cannot be turned off (see footnote 2) 91 | 92 | //9. ... 93 | 94 | //10. Profit! 95 | } 96 | } 97 | } -------------------------------------------------------------------------------- /src/NFeature/DefaultImplementations/ManifestCreationStrategyConsideringStateCookieTenantAndTime.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature.DefaultImplementations 19 | { 20 | using System; 21 | using System.Web; 22 | using Configuration; 23 | using NBasicExtensionMethod; 24 | 25 | /// 26 | /// Constructs the feature manifest according to the tenancy context, the existence of the preview cookie and feature configuration. This provides an example manifest creation strategy, and is replaceable. 27 | /// 28 | public class ManifestCreationStrategyConsideringStateCookieTenantAndTime : 30 | IFeatureManifestCreationStrategy 31 | 32 | where TFeatureEnum : struct 33 | where TTenantEnum : struct 34 | { 35 | public const string FeaturePreviewCookieName = "FeaturePreviewCookie"; 36 | private readonly IApplicationClock _clock; 37 | private readonly IFeatureSettingService> _featureSettingService; 38 | private readonly IFeatureSettingRepository _featureSettingsRepository; 39 | private readonly HttpContextBase _httpContext; 40 | private readonly ITenancyContext _tenancyContext; 41 | 42 | public ManifestCreationStrategyConsideringStateCookieTenantAndTime( 43 | IFeatureSettingService> featureSettingService, 44 | IFeatureSettingRepository featureSettingsRepository, 45 | HttpContextBase httpContext, 46 | ITenancyContext tenancyContext, 47 | IApplicationClock clock) { 48 | _featureSettingService = featureSettingService; 49 | _featureSettingsRepository = featureSettingsRepository; 50 | _httpContext = httpContext; 51 | _tenancyContext = tenancyContext; 52 | _clock = clock; 53 | } 54 | 55 | public IFeatureManifest CreateFeatureManifest() { 56 | FeatureSetting[] featureSettings = _featureSettingsRepository.GetFeatureSettings(); 57 | var manifest = new FeatureManifest(); 58 | 59 | foreach (var setting in featureSettings) { 60 | FeatureVisibilityMode featureVisibilityMode = _httpContext.Request.Cookies[FeaturePreviewCookieName].IsNotNull() 61 | ? FeatureVisibilityMode.Preview 62 | : FeatureVisibilityMode.Normal; 63 | 64 | bool isAvailable = _featureSettingService 65 | .AllDependenciesAreSatisfiedForTheFeatureSetting(setting, 66 | new Tuple 67 | ( 69 | featureVisibilityMode, 70 | _tenancyContext.CurrentTenant, 71 | _clock.Now)); 72 | 73 | manifest.Add(setting.Feature, 74 | new FeatureDescriptor(setting.Feature) { 75 | Dependencies = 76 | setting.Dependencies, 77 | IsAvailable = 78 | isAvailable, 79 | Settings = 80 | setting.Settings, 81 | }); 82 | } 83 | 84 | return manifest; 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /src/NFeature.DefaultTenant.Test.Slow/NFeature.DefaultTenant.Test.Slow.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA} 9 | Library 10 | Properties 11 | NFeature.DefaultTenant.Test.Slow 12 | NFeature.DefaultTenant.Test.Slow 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | False 36 | ..\packages\Newtonsoft.Json.4.5.7\lib\net40\Newtonsoft.Json.dll 37 | 38 | 39 | False 40 | ..\packages\NFeature.Configuration.1.0.4554.36639\lib\net40\NFeature.Configuration.dll 41 | 42 | 43 | False 44 | ..\packages\NHelpfulException.1.0.4554.34109\lib\net40\NHelpfulException.dll 45 | 46 | 47 | False 48 | ..\packages\NSure.1.0.4554.34428\lib\net40\NSure.dll 49 | 50 | 51 | False 52 | ..\packages\NUnit.2.6.0.12054\lib\nunit.framework.dll 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Designer 71 | 72 | 73 | 74 | 75 | 76 | {8889710B-2420-495F-94FC-A649C348ADB4} 77 | NFeature 78 | 79 | 80 | 81 | 88 | -------------------------------------------------------------------------------- /src/NFeature/FeatureSettingAvailabilityChecker`3.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using Configuration; 24 | using Exceptions; 25 | using NBasicExtensionMethod; 26 | using NSure; 27 | using ArgumentNullException = NHelpfulException.FrameworkExceptions.ArgumentNullException; 28 | 29 | /// 30 | /// NOTE 1: BA; we maintain a list of features we have met and not yet resolved the dependencies for. If we come across a feature and find it in the featuresUnderAnalysis list then we realise that resolution of a feature's dependency graph depends on resolution of it's graph and hence we cannot complete, and we throw an exception. NOTE 2: BA; the dependencies of established features must themselves all be established. NOTE 3: BA; required due to recursive invocation. 31 | /// 32 | public class FeatureSettingAvailabilityChecker : 33 | IFeatureSettingAvailabilityChecker 34 | where TFeatureEnum : struct 35 | where TTenant : struct 36 | { 37 | protected Func, TAvailabilityCheckArgs, bool> 38 | AvailabilityCheckFunction; 39 | 40 | public FeatureSettingAvailabilityChecker( 41 | Func, TAvailabilityCheckArgs, bool> 42 | availabilityCheckFunction) { 43 | AvailabilityCheckFunction = availabilityCheckFunction; 44 | } 45 | 46 | /// 47 | /// Responsible for checking whether the dependencies for a feature are met. TODO: review use of tuple for params for custom availability checking fucntionality. 48 | /// 49 | public bool RecursivelyCheckAvailability( 50 | FeatureSetting featureSettingToCheck, 51 | FeatureSetting[] allFeatureSettings, 52 | TAvailabilityCheckArgs availabilityCheckArgs = 53 | default(TAvailabilityCheckArgs), 54 | List> 55 | featuresCurrentlyUnderAnalysis = null) { 56 | Ensure.That(featureSettingToCheck.IsNotNull(), 57 | "featureSetting not supplied.") 58 | .And(allFeatureSettings.IsNotNull(), 59 | "allFeatureSettings not supplied."); 60 | 61 | featuresCurrentlyUnderAnalysis = featuresCurrentlyUnderAnalysis ?? 62 | new List>(); 63 | if (featuresCurrentlyUnderAnalysis.Contains(featureSettingToCheck)) //see note 1 64 | { 65 | throw new CircularFeatureSettingDependencyException(); 66 | } 67 | 68 | featuresCurrentlyUnderAnalysis.Add(featureSettingToCheck); 69 | 70 | foreach (TFeatureEnum dependency in featureSettingToCheck.Dependencies) { 71 | try { 72 | TFeatureEnum dependencyClosedOver = dependency; 73 | FeatureSetting dependencySetting = 74 | allFeatureSettings.First(s => s.Feature.Equals(dependencyClosedOver)); 75 | 76 | if (featureSettingToCheck.FeatureState == FeatureState.Established 77 | && dependencySetting.FeatureState != FeatureState.Established) //see note 2 78 | { 79 | throw new EstablishedFeatureDependencyException( 80 | featureSettingToCheck.Feature, dependencyClosedOver); 81 | } 82 | 83 | if (!RecursivelyCheckAvailability(dependencySetting, 84 | allFeatureSettings, 85 | availabilityCheckArgs, 86 | featuresCurrentlyUnderAnalysis)) { 87 | return false; 88 | } 89 | } catch (InvalidOperationException e) { 90 | throw new FeatureNotConfiguredException(dependency, e); 91 | } 92 | } 93 | 94 | featuresCurrentlyUnderAnalysis.Remove(featureSettingToCheck); //see note 3 95 | 96 | return AvailabilityCheckFunction(featureSettingToCheck, availabilityCheckArgs); 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /src/NFeature/FeatureEnumExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright 2012, Ben Aston (ben@bj.ma). 2 | // 3 | // This file is part of NFeature. 4 | // 5 | // NFeature is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // NFeature is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with NFeature. If not, see . 17 | 18 | namespace NFeature 19 | { 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Reflection; 24 | using Configuration; 25 | using Configuration.Exceptions; 26 | using Exceptions; 27 | using NBasicExtensionMethod; 28 | using NSure; 29 | using ArgumentNullException = NHelpfulException.FrameworkExceptions.ArgumentNullException; 30 | 31 | public static class FeatureEnumExtensions 32 | { 33 | public static bool IsAvailable(this TFeatureEnum feature, 34 | IFeatureManifest featureManifest) 35 | where TFeatureEnum : struct { 36 | Ensure.That(featureManifest.IsNotNull(), 37 | "featureManifest not supplied."); 38 | 39 | try { 40 | return featureManifest[feature].IsAvailable; 41 | } catch (KeyNotFoundException e) { 42 | throw new FeatureNotConfiguredException(feature, e); 43 | } 44 | } 45 | 46 | public static dynamic Setting(this TFeatureEnum feature, 47 | Enum settingName, 48 | IFeatureManifest featureManifest) 49 | where TFeatureEnum : struct { 50 | Ensure.That(featureManifest.IsNotNull(), 51 | "featureManifest not supplied.") 52 | .And(feature.IsAvailable(featureManifest), 53 | string.Format("Specified feature '{0}' is unavailable.", 54 | Enum.GetName(typeof (TFeatureEnum), 55 | feature))); 56 | 57 | try { 58 | //todo: refactor 59 | string enumItemName = Enum.GetName(settingName.GetType(), settingName); 60 | FieldInfo enumItemMember = settingName.GetType().GetField(enumItemName); 61 | string enumItemFullName = null; 62 | 63 | if (enumItemMember != null) { 64 | var attribute = (FeatureSettingAttribute) 65 | enumItemMember.GetCustomAttributes(typeof (FeatureSettingAttribute), false) 66 | .FirstOrDefault(); 67 | if (attribute != null) { 68 | enumItemFullName = attribute.FullName; 69 | } 70 | } 71 | 72 | return featureManifest[feature].Settings[enumItemFullName ?? enumItemName]; 73 | } catch (Exception e) { 74 | throw new Exception(string.Format("Unable to find setting \"{0}\".", settingName), e); 75 | } 76 | } 77 | 78 | /// 79 | /// Designed for use for features that the feature subsystem itself depends upon. Provides a way of retrieving feature setting information without the FeatureManifest being pre-instantiated. 80 | /// 81 | internal static string Setting(this TFeatureEnum feature, 82 | Enum settingName, 83 | IFeatureSettingRepository 84 | 85 | featureSettingRepository) 86 | where TFeatureEnum : struct 87 | where TTenantEnum : struct { 88 | try { 89 | FeatureSetting[] featureSettings = featureSettingRepository.GetFeatureSettings(); 90 | FeatureSetting featureSetting = featureSettings.First(s => s.Feature.Equals(feature)); //was == 91 | Ensure.That>(featureSetting.IsRequiredByFeatureSubsystem, "Specified feature not marked as being required by the feature subsystem."); 92 | 93 | return featureSetting.Settings[Enum.GetName(settingName.GetType(), settingName)]; 94 | } catch (Exception e) { 95 | throw new Exception(string.Format("Unable to find setting \"{0}\".", settingName), e); 96 | } 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /src/NFeature.Test.Slow/NFeature.Test.Slow.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1} 9 | Library 10 | Properties 11 | NFeature.Test.Slow 12 | NFeature.Test.Slow 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | true 35 | bin\Staging\ 36 | DEBUG;TRACE 37 | full 38 | AnyCPU 39 | bin\Debug\NFeature.Test.Slow.dll.CodeAnalysisLog.xml 40 | true 41 | GlobalSuppressions.cs 42 | prompt 43 | MinimumRecommendedRules.ruleset 44 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 45 | true 46 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 47 | true 48 | 49 | 50 | 51 | ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll 52 | 53 | 54 | False 55 | ..\packages\Newtonsoft.Json.4.5.7\lib\net40\Newtonsoft.Json.dll 56 | 57 | 58 | False 59 | ..\packages\NFeature.Configuration.1.0.4554.36639\lib\net40\NFeature.Configuration.dll 60 | 61 | 62 | False 63 | ..\packages\NHelpfulException.1.0.4554.34109\lib\net40\NHelpfulException.dll 64 | 65 | 66 | False 67 | ..\packages\NSure.1.0.4554.34428\lib\net40\NSure.dll 68 | 69 | 70 | False 71 | ..\packages\NUnit.2.6.0.12054\lib\nunit.framework.dll 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | Designer 93 | 94 | 95 | 96 | 97 | 98 | {8889710B-2420-495F-94FC-A649C348ADB4} 99 | NFeature 100 | 101 | 102 | 103 | 110 | -------------------------------------------------------------------------------- /src/NFeature.Test.Fast/NFeature.Test.Fast.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3} 9 | Library 10 | Properties 11 | NFeature.Test.Fast 12 | NFeature.Test.Fast 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | true 35 | bin\Staging\ 36 | DEBUG;TRACE 37 | full 38 | AnyCPU 39 | bin\Debug\NFeature.Test.Fast.dll.CodeAnalysisLog.xml 40 | true 41 | GlobalSuppressions.cs 42 | prompt 43 | MinimumRecommendedRules.ruleset 44 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 45 | true 46 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 47 | true 48 | false 49 | 50 | 51 | 52 | ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll 53 | 54 | 55 | False 56 | ..\packages\NBasicExtensionMethod.1.0.4554.34582\lib\net40\NBasicExtensionMethod.dll 57 | 58 | 59 | False 60 | ..\packages\Newtonsoft.Json.4.5.7\lib\net40\Newtonsoft.Json.dll 61 | 62 | 63 | False 64 | ..\packages\NFeature.Configuration.1.0.4554.36639\lib\net40\NFeature.Configuration.dll 65 | 66 | 67 | False 68 | ..\packages\NHelpfulException.1.0.4554.34109\lib\net40\NHelpfulException.dll 69 | 70 | 71 | False 72 | ..\packages\NSure.1.0.4554.34428\lib\net40\NSure.dll 73 | 74 | 75 | False 76 | ..\packages\NUnit.2.6.0.12054\lib\nunit.framework.dll 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | {8889710B-2420-495F-94FC-A649C348ADB4} 107 | NFeature 108 | 109 | 110 | 111 | 118 | -------------------------------------------------------------------------------- /src/NFeature.Example.Console/NFeature.Example.Console.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {F20A8857-26F2-4212-9663-91C8823942BE} 9 | Exe 10 | Properties 11 | NFeature.Example.Console 12 | NFeature.Example.Console 13 | v4.0 14 | 15 | 16 | 512 17 | publish\ 18 | true 19 | Disk 20 | false 21 | Foreground 22 | 7 23 | Days 24 | false 25 | false 26 | true 27 | 0 28 | 1.0.0.%2a 29 | false 30 | false 31 | true 32 | 33 | 34 | x86 35 | true 36 | full 37 | false 38 | bin\Debug\ 39 | DEBUG;TRACE 40 | prompt 41 | 4 42 | 43 | 44 | x86 45 | pdbonly 46 | true 47 | bin\Release\ 48 | TRACE 49 | prompt 50 | 4 51 | 52 | 53 | true 54 | bin\x86\Staging\ 55 | DEBUG;TRACE 56 | full 57 | x86 58 | bin\Debug\NFeature.Example.Console.exe.CodeAnalysisLog.xml 59 | true 60 | GlobalSuppressions.cs 61 | prompt 62 | MinimumRecommendedRules.ruleset 63 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 64 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 65 | 66 | 67 | 68 | False 69 | ..\packages\Newtonsoft.Json.4.5.7\lib\net40\Newtonsoft.Json.dll 70 | 71 | 72 | False 73 | ..\packages\NFeature.Configuration.1.0.4554.36639\lib\net40\NFeature.Configuration.dll 74 | 75 | 76 | False 77 | ..\packages\NHelpfulException.1.0.4554.34109\lib\net40\NHelpfulException.dll 78 | 79 | 80 | False 81 | ..\packages\NSure.1.0.4554.34428\lib\net40\NSure.dll 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | {8889710B-2420-495F-94FC-A649C348ADB4} 98 | NFeature 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | False 108 | Microsoft .NET Framework 4 %28x86 and x64%29 109 | true 110 | 111 | 112 | False 113 | .NET Framework 3.5 SP1 Client Profile 114 | false 115 | 116 | 117 | False 118 | .NET Framework 3.5 SP1 119 | false 120 | 121 | 122 | False 123 | Windows Installer 3.1 124 | true 125 | 126 | 127 | 128 | 135 | -------------------------------------------------------------------------------- /src/NFeature/NFeature.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {8889710B-2420-495F-94FC-A649C348ADB4} 9 | Library 10 | Properties 11 | NFeature 12 | NFeature 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | true 35 | bin\Staging\ 36 | DEBUG;TRACE 37 | full 38 | AnyCPU 39 | bin\Debug\NFeature.dll.CodeAnalysisLog.xml 40 | true 41 | GlobalSuppressions.cs 42 | prompt 43 | MinimumRecommendedRules.ruleset 44 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets 45 | false 46 | ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules 47 | false 48 | 49 | 50 | true 51 | 52 | 53 | keypair.snk 54 | 55 | 56 | 57 | False 58 | ..\packages\NBasicExtensionMethod.1.0.4554.34582\lib\net40\NBasicExtensionMethod.dll 59 | 60 | 61 | False 62 | ..\packages\Newtonsoft.Json.4.5.7\lib\net40\Newtonsoft.Json.dll 63 | 64 | 65 | False 66 | ..\packages\NFeature.Configuration.1.0.4554.36639\lib\net40\NFeature.Configuration.dll 67 | 68 | 69 | False 70 | ..\packages\NHelpfulException.1.0.4554.34109\lib\net40\NHelpfulException.dll 71 | 72 | 73 | False 74 | ..\packages\NSure.1.0.4554.34428\lib\net40\NSure.dll 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 137 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | NFeature 2 | ==== 3 | 4 | A simple feature configuration system (or feature toggle / flipper / whatever you want to call it.) 5 | 6 | If you like NFeature, please let others know by sending a tweet (opens a form in a new window to send a tweet). 7 | 8 | Feature configuration walls enable you to integrate your code earlier, which brings lots of goodness (such as helping to avoid branch merge problems.) 9 | 10 | Example of use: 11 | 12 | ```C# 13 | 14 | 15 | if(Feature.MyCoolFeature.IsAvailable(manifest)) { 16 | //do some cool stuff 17 | } 18 | 19 | 20 | ``` 21 | 22 | If NFeature helps you or your team develop great software please [let me know](mailto:ben@bj.ma "Ben's email address")! It will help motivate me to develop and improve NFeature. 23 | 24 | 25 | How to use: 26 | -------- 27 | **-1. Check the target framework of your application** 28 | 29 | It *must* be ```.NET Framework 4``` (*not* the ```Client Profile``` version - or you might get strange compilation errors.) 30 | 31 | 32 | **0. Get it** 33 | 34 | ```shell 35 | nuget install nfeature 36 | ``` 37 | 38 | 39 | **1. Define some features** 40 | 41 | In your code: 42 | 43 | ```C# 44 | 45 | 46 | public enum Feature { 47 | MyFeature, 48 | MyOtherFeature, 49 | MyOtherOtherFeature, 50 | } 51 | 52 | 53 | ``` 54 | 55 | In your configuration: (see also footnote 1) 56 | 57 | *NOTE: remember to replace ```Your.Feature.Type``` and ```Your.Feature.Type.Assembly``` in the text below.* 58 | 59 | ```XML 60 | ... 61 | 62 | ... 63 | 66 |
67 | ... 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | ... 76 | 77 | ``` 78 | 79 | **2. Define the availability-checking function** 80 | 81 | 82 | ```C# 83 | 84 | 85 | //Here is a function that will only return 'true' if the feature is MyFeature. 86 | //Your function might be more elaborate. For example: feature availability might 87 | //depend upon site load, user role or presence of a cookie. 88 | Func, EmptyArgs, bool> fn = (f, args) => f.Feature == Feature.MyFeature; 89 | 90 | ``` 91 | 92 | **3. Take care of feature manifest initialization** 93 | 94 | *For a working example of this see the integration test named ```FeatureEnumExtensionsTests``` in the ```NFeature.Test.Slow``` project, within the main solution.* 95 | 96 | ```C# 97 | 98 | 99 | //NOTE: I suggest hiding this ugly initialization logic away in the IOC container configuration 100 | var featureSettingRepo = new AppConfigFeatureSettingRepository(); 101 | var availabilityChecker = new FeatureSettingAvailabilityChecker(fn); //from step 2 102 | var featureSettingService = new FeatureSettingService(availabilityChecker, featureSettingRepo); 103 | var manifestCreationStrategy = new NFeature.DefaultImplementations.ManifestCreationStrategyDefault(featureSettingRepo, featureSettingService); //we use the default for this example 104 | var featureManifestService = new FeatureManifestService(manifestCreationStrategy); 105 | var featureManifest = featureManifestService.GetManifest(); 106 | 107 | 108 | ``` 109 | 110 | 111 | **4. Configure feature dependencies (if there are any)** 112 | 113 | ```XML 114 | 115 | 116 | 117 | 118 | 119 | 120 | ``` 121 | 122 | 123 | **5. Add code that is conditional on feature availability** 124 | 125 | ```C# 126 | 127 | //featureManifest ideally supplied via IOC container 128 | if(Feature.MyFeature.IsAvailable(featureManifest)) { 129 | //do some cool stuff 130 | } 131 | 132 | ``` 133 | 134 | 135 | **6. Optionally configure feature-specific settings using Json (neatly side-stepping the need for angle brackets)** 136 | 137 | *Arbitrary JSON is supported through the use of ```dynamic``` objects.* 138 | 139 | ```XML 140 | 141 | 142 | 143 | 145 | 146 | 147 | ``` 148 | 149 | **7. Optionally specify dates for feature availability** 150 | 151 | ```XML 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | ``` 161 | 162 | **8. At some future date... optionally mark your feature as ```Established``` to indicate that it is now integral to your application and cannot be turned off (see footnote 2)** 163 | 164 | *Any availability checks for ```Established``` features will throw an exception, forcing their removal (as is good practice.)* 165 | 166 | ```XML 167 | 168 | 169 | 170 | 171 | 172 | 173 | ``` 174 | 175 | **9. ...** 176 | 177 | **10. Profit!** 178 | 179 | 180 | How to build and/or run the tests: 181 | -------- 182 | 183 | 1. Run `/build/build.bat` 184 | 1. Type in the desired option 185 | 1. Hit return 186 | 187 | 188 | 189 | **Footnote 1:** 190 | Please note that the logic to determine whether a feature is available is specified in the ```IFeatureManifestCreationStrategy``` instance you inject into the ```FeatureManifestService``` and (optionally, depending on your implementation of the aforementioned strategy) by the availability-checking function you inject into the ```FeatureSettingAvailabilityChecker```. 191 | 192 | Two concrete implementations of ```IFeatureManifestCreationStrategy``` are provided of-the-box: ```ManifestCreationStrategyDefault``` and ```ManifestCreationStrategyConsideringStateCookieTenantAndTime```. A single default availability checker function is provided out of the box ```DefaultFunctions.AvailabilityCheckFunction```, which may be used when the feature state, tenant, feature visibility mode and system time are known. 193 | 194 | **Footnote 2:** 195 | Marking a feature as ```Established``` changes the behavior of the feature in the following way: 196 | 197 | - all dependencies must be ```Established``` 198 | - checking the feature's availability will throw an exception (because it is now always available by definition) 199 | 200 | 201 | **NOTE: this is pre-release quality software. There will be bugs/inaccuracies in the documentation. If you find an issue, please help me by adding an issue here on GitHub.** 202 | 203 | 204 | License & Copyright 205 | -------- 206 | 207 | This software is released under the GNU Lesser GPL. It is Copyright 2012, Ben Aston. I may be contacted at ben@bj.ma. 208 | 209 | 210 | How to Contribute 211 | -------- 212 | 213 | Pull requests including bug fixes, new features and improved test coverage are welcomed. Please do your best, where possible, to follow the style of code found in the existing codebase. 214 | 215 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/benaston/NFeature/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 216 | -------------------------------------------------------------------------------- /src/NFeature.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NFeature", "NFeature\NFeature.csproj", "{8889710B-2420-495F-94FC-A649C348ADB4}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NFeature.Test.Fast", "NFeature.Test.Fast\NFeature.Test.Fast.csproj", "{8978DCAE-C678-4003-AD76-81EA4D7AF7D3}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NFeature.Test.Slow", "NFeature.Test.Slow\NFeature.Test.Slow.csproj", "{5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NFeature.Example.Console", "NFeature.Example.Console\NFeature.Example.Console.csproj", "{F20A8857-26F2-4212-9663-91C8823942BE}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NFeature.DefaultTenant.Test.Slow", "NFeature.DefaultTenant.Test.Slow\NFeature.DefaultTenant.Test.Slow.csproj", "{9782F64B-9236-4D95-B9AE-6FACCC915DEA}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Debug|Mixed Platforms = Debug|Mixed Platforms 18 | Debug|x86 = Debug|x86 19 | Release|Any CPU = Release|Any CPU 20 | Release|Mixed Platforms = Release|Mixed Platforms 21 | Release|x86 = Release|x86 22 | Staging|Any CPU = Staging|Any CPU 23 | Staging|Mixed Platforms = Staging|Mixed Platforms 24 | Staging|x86 = Staging|x86 25 | EndGlobalSection 26 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 27 | {8889710B-2420-495F-94FC-A649C348ADB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 28 | {8889710B-2420-495F-94FC-A649C348ADB4}.Debug|Any CPU.Build.0 = Debug|Any CPU 29 | {8889710B-2420-495F-94FC-A649C348ADB4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 30 | {8889710B-2420-495F-94FC-A649C348ADB4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 31 | {8889710B-2420-495F-94FC-A649C348ADB4}.Debug|x86.ActiveCfg = Debug|Any CPU 32 | {8889710B-2420-495F-94FC-A649C348ADB4}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {8889710B-2420-495F-94FC-A649C348ADB4}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {8889710B-2420-495F-94FC-A649C348ADB4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 35 | {8889710B-2420-495F-94FC-A649C348ADB4}.Release|Mixed Platforms.Build.0 = Release|Any CPU 36 | {8889710B-2420-495F-94FC-A649C348ADB4}.Release|x86.ActiveCfg = Release|Any CPU 37 | {8889710B-2420-495F-94FC-A649C348ADB4}.Staging|Any CPU.ActiveCfg = Staging|Any CPU 38 | {8889710B-2420-495F-94FC-A649C348ADB4}.Staging|Any CPU.Build.0 = Staging|Any CPU 39 | {8889710B-2420-495F-94FC-A649C348ADB4}.Staging|Mixed Platforms.ActiveCfg = Staging|Any CPU 40 | {8889710B-2420-495F-94FC-A649C348ADB4}.Staging|Mixed Platforms.Build.0 = Staging|Any CPU 41 | {8889710B-2420-495F-94FC-A649C348ADB4}.Staging|x86.ActiveCfg = Staging|Any CPU 42 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 45 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 46 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Debug|x86.ActiveCfg = Debug|Any CPU 47 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Release|Any CPU.ActiveCfg = Release|Any CPU 48 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Release|Any CPU.Build.0 = Release|Any CPU 49 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 50 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Release|Mixed Platforms.Build.0 = Release|Any CPU 51 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Release|x86.ActiveCfg = Release|Any CPU 52 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Staging|Any CPU.ActiveCfg = Staging|Any CPU 53 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Staging|Any CPU.Build.0 = Staging|Any CPU 54 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Staging|Mixed Platforms.ActiveCfg = Staging|Any CPU 55 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Staging|Mixed Platforms.Build.0 = Staging|Any CPU 56 | {8978DCAE-C678-4003-AD76-81EA4D7AF7D3}.Staging|x86.ActiveCfg = Staging|Any CPU 57 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 58 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Debug|Any CPU.Build.0 = Debug|Any CPU 59 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 60 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 61 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Debug|x86.ActiveCfg = Debug|Any CPU 62 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Release|Any CPU.ActiveCfg = Release|Any CPU 63 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Release|Any CPU.Build.0 = Release|Any CPU 64 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 65 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Release|Mixed Platforms.Build.0 = Release|Any CPU 66 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Release|x86.ActiveCfg = Release|Any CPU 67 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Staging|Any CPU.ActiveCfg = Release|Any CPU 68 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Staging|Any CPU.Build.0 = Release|Any CPU 69 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Staging|Mixed Platforms.ActiveCfg = Staging|Any CPU 70 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Staging|Mixed Platforms.Build.0 = Staging|Any CPU 71 | {5AF1B8EA-FA20-403A-B7F0-AD38C30EE4C1}.Staging|x86.ActiveCfg = Release|Any CPU 72 | {F20A8857-26F2-4212-9663-91C8823942BE}.Debug|Any CPU.ActiveCfg = Debug|x86 73 | {F20A8857-26F2-4212-9663-91C8823942BE}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 74 | {F20A8857-26F2-4212-9663-91C8823942BE}.Debug|Mixed Platforms.Build.0 = Debug|x86 75 | {F20A8857-26F2-4212-9663-91C8823942BE}.Debug|x86.ActiveCfg = Debug|x86 76 | {F20A8857-26F2-4212-9663-91C8823942BE}.Debug|x86.Build.0 = Debug|x86 77 | {F20A8857-26F2-4212-9663-91C8823942BE}.Release|Any CPU.ActiveCfg = Release|x86 78 | {F20A8857-26F2-4212-9663-91C8823942BE}.Release|Mixed Platforms.ActiveCfg = Release|x86 79 | {F20A8857-26F2-4212-9663-91C8823942BE}.Release|Mixed Platforms.Build.0 = Release|x86 80 | {F20A8857-26F2-4212-9663-91C8823942BE}.Release|x86.ActiveCfg = Release|x86 81 | {F20A8857-26F2-4212-9663-91C8823942BE}.Release|x86.Build.0 = Release|x86 82 | {F20A8857-26F2-4212-9663-91C8823942BE}.Staging|Any CPU.ActiveCfg = Release|x86 83 | {F20A8857-26F2-4212-9663-91C8823942BE}.Staging|Mixed Platforms.ActiveCfg = Staging|x86 84 | {F20A8857-26F2-4212-9663-91C8823942BE}.Staging|Mixed Platforms.Build.0 = Staging|x86 85 | {F20A8857-26F2-4212-9663-91C8823942BE}.Staging|x86.ActiveCfg = Release|x86 86 | {F20A8857-26F2-4212-9663-91C8823942BE}.Staging|x86.Build.0 = Release|x86 87 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 88 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Debug|Any CPU.Build.0 = Debug|Any CPU 89 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 90 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 91 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Debug|x86.ActiveCfg = Debug|Any CPU 92 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Release|Any CPU.ActiveCfg = Release|Any CPU 93 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Release|Any CPU.Build.0 = Release|Any CPU 94 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 95 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Release|Mixed Platforms.Build.0 = Release|Any CPU 96 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Release|x86.ActiveCfg = Release|Any CPU 97 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Staging|Any CPU.ActiveCfg = Release|Any CPU 98 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Staging|Any CPU.Build.0 = Release|Any CPU 99 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Staging|Mixed Platforms.ActiveCfg = Release|Any CPU 100 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Staging|Mixed Platforms.Build.0 = Release|Any CPU 101 | {9782F64B-9236-4D95-B9AE-6FACCC915DEA}.Staging|x86.ActiveCfg = Release|Any CPU 102 | EndGlobalSection 103 | GlobalSection(SolutionProperties) = preSolution 104 | HideSolutionNode = FALSE 105 | EndGlobalSection 106 | EndGlobal 107 | -------------------------------------------------------------------------------- /COPYING.LESSER: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. --------------------------------------------------------------------------------