示例#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));
        }