예제 #1
0
        public void Get_ExistentFeatureToggleId_ResponseCode200()
        {
            var result = new FeatureToggleApiController(LoadFeatureToggles).Get(enabledFeatureToggleId, enabledUserId);

            Assert.That(result, Is.AssignableTo <IStatusCodeActionResult>());
            Assert.That(((IStatusCodeActionResult)result).StatusCode, Is.EqualTo((int)HttpStatusCode.OK));
        }
예제 #2
0
        public void Get_FeatureToggleIsDisabledAndUserIsDisabled_FlagInResponseIsFalse()
        {
            var result = new FeatureToggleApiController(LoadFeatureToggles).Get(disabledFeatureToggleId, disabledUserId);

            Assert.That(result, Is.AssignableTo <ObjectResult>());
            var objectResult = (ObjectResult)result;

            Assert.That(objectResult.Value, Is.AssignableTo <FeatureToggleResponse>());
            var featureToggleResponse = (FeatureToggleResponse)objectResult.Value;

            Assert.That(featureToggleResponse.IsActive, Is.False);
        }
예제 #3
0
        public void Get_ExistentFeatureToggleId_FeatureToggleIdMatchesRequest()
        {
            var result = new FeatureToggleApiController(LoadFeatureToggles).Get(enabledFeatureToggleId, enabledUserId);

            Assert.That(result, Is.AssignableTo <ObjectResult>());
            var objectResult = (ObjectResult)result;

            Assert.That(objectResult.Value, Is.AssignableTo <FeatureToggleResponse>());
            var featureToggleResponse = (FeatureToggleResponse)objectResult.Value;

            Assert.That(featureToggleResponse.Id, Is.EqualTo(enabledFeatureToggleId));
        }