Skip to content

Commit

Permalink
Use MEF v.1 tests
Browse files Browse the repository at this point in the history
Integration tests.
  • Loading branch information
Boggin committed Dec 13, 2018
1 parent 44dfac3 commit f261735
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 5 deletions.
6 changes: 6 additions & 0 deletions DisabledFeatureFlagger.cs
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
namespace RoyalLondon.IntermediaryManagement.Api.FeatureFlagger
{
public class DisabledFeatureFlagger : IFeatureFlagger
{
}
}
6 changes: 1 addition & 5 deletions ExampleFeatureFlagger.cs
Original file line number Diff line number Diff line change
@@ -1,9 1,5 @@
namespace RoyalLondon.IntermediaryManagement.Api.FeatureFlagger.Features
namespace RoyalLondon.IntermediaryManagement.Api.FeatureFlagger
{
/*
* SSO (Single Sign On) will gradually become available so
* this flag is to manage the roll-out.
*/
public class ExampleFeatureFlagger : IFeatureFlagger
{
}
Expand Down
58 changes: 58 additions & 0 deletions FeatureFlaggerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 1,58 @@
namespace RoyalLondon.IntermediaryManagement.Api.FeatureFlagger
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public class FeatureFlaggerTests
{
[TestMethod]
public void ShouldUseBasicEnabledFlag()
{
var featureFlag = new ExampleFeatureFlagger();

var isEnabled = featureFlag.IsEnabled();

Assert.IsTrue(isEnabled);
}

[TestMethod]
public void ShouldFailDisabledFlag()
{
var featureFlag = new DisabledFeatureFlagger();

var isEnabled = featureFlag.IsEnabled();

Assert.IsFalse(isEnabled);
}

[TestMethod]
public void ShouldUseFromFlag()
{
var featureFlag = new FromFeatureFlagger();

var isEnabled = featureFlag.IsEnabled();

Assert.IsTrue(isEnabled);
}

[TestMethod]
public void ShouldUseUserFlag()
{
var featureFlag = new UserFeatureFlagger();

var isEnabled = featureFlag.IsEnabled();

Assert.IsTrue(isEnabled);
}

[TestMethod]
public void ShouldFailUserNotListedFlag()
{
var featureFlag = new UnuserFeatureFlagger();

var isEnabled = featureFlag.IsEnabled();

Assert.IsFalse(isEnabled);
}
}
}
6 changes: 6 additions & 0 deletions FromFeatureFlagger.cs
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
namespace RoyalLondon.IntermediaryManagement.Api.FeatureFlagger
{
public class FromFeatureFlagger : IFeatureFlagger
{
}
}
7 changes: 7 additions & 0 deletions UnuserFeatureFlagger.cs
Original file line number Diff line number Diff line change
@@ -0,0 1,7 @@
namespace RoyalLondon.IntermediaryManagement.Api.FeatureFlagger
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Unuser", Justification = "No, really")]
public class UnuserFeatureFlagger : IFeatureFlagger
{
}
}
6 changes: 6 additions & 0 deletions UserFeatureFlagger.cs
Original file line number Diff line number Diff line change
@@ -0,0 1,6 @@
namespace RoyalLondon.IntermediaryManagement.Api.FeatureFlagger
{
public class UserFeatureFlagger : IFeatureFlagger
{
}
}

0 comments on commit f261735

Please sign in to comment.