Example #1
0
        public async void CanDeleteItem()
        {
            await using (var context = new ConfigurationContext(ContextOptions))
            {
                var controller = new ConfigsController(context);

                var config = (await controller.GetConfigs()).Value.ElementAt(0);
                await controller.DeleteConfig(config.Id);

                Assert.Throws <AggregateException>(() => (controller.GetConfig(config.Id)).Result.Value);
            }
        }
Example #2
0
        public ConfigServiceControllerTest()
        {
            // arrange
            _stringWriter = new StringWriter();
            Console.SetOut(_stringWriter);
            var loggerService = new ConsoleLoggerService();

            _storageService = new LocalStorageService(Constants.ConfigsFileLocalDirectory);

            // act
            _controller = new ConfigsController(loggerService, _storageService);
        }