Exemplo n.º 1
0
        public void GetFeatureFlag_Should_Return_False_for_EJud_Feature()
        {
            _mocker.Mock <IOptions <FeatureFlagConfiguration> >().Setup(opt => opt.Value).Returns(new FeatureFlagConfiguration()
            {
                EJudFeature = false
            });
            _service = _mocker.Create <FeatureFlagService>();

            var featureFlag = _service.GetFeatureFlag(nameof(FeatureFlags.EJudFeature));

            featureFlag.Should().BeFalse();
        }
Exemplo n.º 2
0
        public void GetFeatureFlag_Should_Return_True_for_StaffMember_Feature()
        {
            _mocker.Mock <IOptions <FeatureFlagConfiguration> >().Setup(opt => opt.Value).Returns(new FeatureFlagConfiguration()
            {
                StaffMemberFeature = true
            });
            _service = _mocker.Create <FeatureFlagService>();

            var featureFlag = _service.GetFeatureFlag(nameof(FeatureFlags.StaffMemberFeature));

            featureFlag.Should().BeTrue();
        }
Exemplo n.º 3
0
        public void GetFeatureFlag_Should_Throw_FeatureFlagNotFoundException()
        {
            _service = _mocker.Create <FeatureFlagService>();

            Assert.Throws <FeatureFlagNotFoundException>(() => _service.GetFeatureFlag("TestFeature"));
        }