Exemple #1
0
        public async Task <bool> IsActive(Guid toggleID, IToggleContext context)
        {
            var toggles = await _fetcher.GetAllToggles();

            if (toggles.TryGetValue(toggleID, out var toggle) == false)
            {
                throw new ToggleNotFoundException(toggleID);
            }

            return(toggle.IsActive(_writer, context));
        }
Exemple #2
0
        public void When_a_toggle_is_not_found_by_id()
        {
            _fetcher.GetAllToggles().Returns(new Dictionary <Guid, Toggle>());

            Should.Throw <ToggleNotFoundException>(() => _service.IsActive(Guid.NewGuid(), null));
        }