예제 #1
0
        public void UpdateToggleAsyncShouldUpdateToggle()
        {
            _mockToggleRepository
            .Setup(m => m.GetByIdAsync(1))
            .Returns(Task.FromResult(ToggleHelper.ToggleList().First()));

            var toggle = _mocktoggleService.UpdateToggleAsync(ToggleHelper.ToggleList().First());

            toggle.Should().NotBeNull();
        }
예제 #2
0
        public void GetAllTogglesFromApplicationAsyncShouldReturnToggles()
        {
            _mockToggleRepository
            .Setup(m => m.GetByIdAsync(3))
            .Returns(Task.FromResult(ToggleHelper.ToggleList().First()));

            var toggle = _mocktoggleService.GetAllTogglesFromApplicationAsync(3, "2.0");

            toggle.Should().NotBeNull();
        }
예제 #3
0
        public void GetToggleByIdAsyncShouldBeNull()
        {
            _mockToggleRepository
            .Setup(m => m.GetByIdAsync(1))
            .Returns(Task.FromResult(ToggleHelper.ToggleList().First()));

            var result = _mocktoggleService.GetToggleByIdAsync(20);

            result.Result.Should().BeNull();
        }
예제 #4
0
        public async Task GetAllTogglesShouldReturnToggles()
        {
            _mockToggleRepository
            .Setup(m => m.GetAllAsync())
            .Returns(Task.FromResult(ToggleHelper.ToggleList()));

            var toggles = await _mocktoggleService.GetAllTogglesAsync();

            toggles.Should().NotBeNull();
        }