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)); }
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); }
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)); }