public async Task RegisterRemovedDeviceTypeSettingOptionTest()
        {
            //Arrange 
            var dbConnection = new StubIEntityContextConnection { NameOrConnectionStringGet = () => "asb-RegisterRemovedDeviceTypeSettingOptionTest" };
            Database.SetInitializer(new CreateFreshDbInitializer());

            var adapterBuilder = new AdapterSettingBuilder(dbConnection, CancellationToken.None);
            var deviceType = UnitTesting.CreateFakeDeviceType();
            var deviceTypeSetting = new DeviceTypeSetting
            {
                Name = "Device Type Setting 1",
                ValueType = DataType.STRING,
                Value = "Hello World",
                DeviceType = deviceType
            };
            var option1 = new DeviceTypeSettingOption
            {
                Name = "Option 1",
            };
            var option2 = new DeviceTypeSettingOption
            {
                Name = "Option 2",
            };
            deviceTypeSetting.Options.Add(option1);
            deviceTypeSetting.Options.Add(option2);
            using (var context = new ZvsContext(dbConnection))
            {
                context.DeviceTypeSettings.Add(deviceTypeSetting);
                await context.SaveChangesAsync();
            }

            deviceTypeSetting.Options.Remove(option2);

            //act
            var result = await adapterBuilder.RegisterDeviceTypeSettingAsync(deviceTypeSetting);

            DeviceTypeSetting setting;
            using (var context = new ZvsContext(dbConnection))
            {
                setting = await context.DeviceTypeSettings
                    .Include(o => o.Options)
                    .FirstOrDefaultAsync();
            }

            //assert 
            Console.WriteLine(result.Message);
            Assert.IsFalse(result.HasError);
            Assert.IsNotNull(setting, "Setting not found");
            Assert.IsTrue(setting.Options.Count == 1, "Expected 2 options");
            Assert.IsTrue(setting.Options[0].Name == option1.Name, "Name mismatch");
        }
        public async Task RegisterNoUpdateDeviceTypeSettingTest()
        {
            //Arrange 
            var dbConnection = new StubIEntityContextConnection { NameOrConnectionStringGet = () => "asb-RegisterNoUpdateDeviceTypeSettingTest" };
            Database.SetInitializer(new CreateFreshDbInitializer());

            var adapterBuilder = new AdapterSettingBuilder(dbConnection, CancellationToken.None);
            var deviceType = UnitTesting.CreateFakeDeviceType();
            var deviceTypeSetting = new DeviceTypeSetting
            {
                Name = "Device Type Setting 1",
                ValueType = DataType.STRING,
                Value = "Hello World",
                DeviceType =  deviceType
            };

            using (var context = new ZvsContext(dbConnection))
            {
                context.DeviceTypeSettings.Add(deviceTypeSetting);
                await context.SaveChangesAsync();
            }

            //act
            var result = await adapterBuilder.RegisterDeviceTypeSettingAsync(deviceTypeSetting);

            DeviceTypeSetting setting;
            using (var context = new ZvsContext(dbConnection))
            {
                setting = await context.DeviceTypeSettings.FirstOrDefaultAsync();
            }

            //assert 
            Console.WriteLine(result.Message);
            Assert.IsFalse(result.HasError);
            Assert.IsNotNull(setting, "Setting not found");
            Assert.IsTrue(setting.Value == deviceTypeSetting.Value, "Device type setting name mismatch");
        }