Esempio n. 1
0
        public async void CanUpdateItem()
        {
            Config config;

            await using (var context = new ConfigurationContext(ContextOptions))
            {
                var controller = new ConfigsController(context);

                config = (await controller.GetConfigs()).Value.ElementAt(0);
            }

            await using (var context = new ConfigurationContext(ContextOptions))
            {
                var controller = new ConfigsController(context);

                config.LastModified = new DateTime(2000, 1, 1, 1, 1, 1);

                await controller.PutConfig(config.Id, config);
            }


            await using (var context = new ConfigurationContext(ContextOptions))
            {
                var controller = new ConfigsController(context);

                var actual = (await controller.GetConfig(config.Id)).Value;

                Assert.Equal(new DateTime(2000, 1, 1, 1, 1, 1), actual.LastModified);
            }
        }