コード例 #1
0
        public async Task GetEvaluatedValue(object outputTypePropertyValue, string expectedMappedValue)
        {
            var properties = ProjectPropertiesFactory.Create(
                UnconfiguredProjectFactory.Create(),
                new PropertyPageData(ConfigurationGeneral.SchemaName, ConfigurationGeneral.OutputTypeProperty, outputTypePropertyValue));
            var provider = new OutputTypeExValueProvider(properties);

            var actualPropertyValue = await provider.OnGetEvaluatedPropertyValueAsync(string.Empty, null!);
            Assert.Equal(expectedMappedValue, actualPropertyValue);
        }
コード例 #2
0
        public async Task SetValue(string incomingValue, string expectedOutputTypeValue)
        {
            var setValues  = new List <object>();
            var properties = ProjectPropertiesFactory.Create(
                UnconfiguredProjectFactory.Create(),
                new PropertyPageData(ConfigurationGeneral.SchemaName, ConfigurationGeneral.OutputTypeProperty, "InitialValue", setValues));
            var provider = new OutputTypeExValueProvider(properties);
            await provider.OnSetPropertyValueAsync(string.Empty, incomingValue, null !);

            Assert.Equal(setValues.Single(), expectedOutputTypeValue);
        }
コード例 #3
0
        public async Task SetValue_ThrowsKeyNotFoundException()
        {
            var setValues  = new List <object>();
            var properties = ProjectPropertiesFactory.Create(
                UnconfiguredProjectFactory.Create(),
                new PropertyPageData(ConfigurationGeneral.SchemaName, ConfigurationGeneral.OutputTypeProperty, "InitialValue", setValues));
            var provider = new OutputTypeExValueProvider(properties);

            await Assert.ThrowsAsync <KeyNotFoundException>(async() =>
            {
                await provider.OnSetPropertyValueAsync(string.Empty, "InvalidValue", null !);
            });
        }
コード例 #4
0
        public async void SetValue(string propertyValue)
        {
            var properties = ProjectPropertiesFactory.Create(
                UnconfiguredProjectFactory.Create(),
                new PropertyPageData()
            {
                Category     = ConfigurationGeneral.SchemaName,
                PropertyName = ConfigurationGeneral.OutputTypeProperty,
                Value        = "InitialValue"
            });
            var provider = new OutputTypeExValueProvider(properties);

            var actualPropertyValue = await provider.OnSetPropertyValueAsync(propertyValue, null);

            Assert.Equal(propertyValue, actualPropertyValue);
        }
コード例 #5
0
        public async void GetEvaluatedValue(object propertyValue, string expectedPropertyValue)
        {
            var properties = ProjectPropertiesFactory.Create(
                UnconfiguredProjectFactory.Create(),
                new PropertyPageData()
            {
                Category     = ConfigurationGeneral.SchemaName,
                PropertyName = ConfigurationGeneral.OutputTypeProperty,
                Value        = propertyValue
            });
            var provider = new OutputTypeExValueProvider(properties);

            var actualPropertyValue = await provider.OnGetEvaluatedPropertyValueAsync(string.Empty, null);

            Assert.Equal(expectedPropertyValue, actualPropertyValue);
        }
コード例 #6
0
        public async Task SetValue(string incomingValue, string expectedOutputTypeValue)
        {
            var setValues  = new List <object>();
            var properties = ProjectPropertiesFactory.Create(
                UnconfiguredProjectFactory.Create(),
                new PropertyPageData()
            {
                Category     = ConfigurationGeneral.SchemaName,
                PropertyName = ConfigurationGeneral.OutputTypeProperty,
                Value        = "InitialValue",
                SetValues    = setValues
            });
            var provider = new OutputTypeExValueProvider(properties);

            var actualPropertyValue = await provider.OnSetPropertyValueAsync(incomingValue, null);

            Assert.Equal(setValues.Single(), expectedOutputTypeValue);
        }
コード例 #7
0
        public async void SetValue_ThrowsKeyNotFoundException()
        {
            var setValues  = new List <object>();
            var properties = ProjectPropertiesFactory.Create(
                UnconfiguredProjectFactory.Create(),
                new PropertyPageData()
            {
                Category     = ConfigurationGeneral.SchemaName,
                PropertyName = ConfigurationGeneral.OutputTypeProperty,
                Value        = "InitialValue",
                SetValues    = setValues
            });
            var provider = new OutputTypeExValueProvider(properties);

            await Assert.ThrowsAsync <KeyNotFoundException>(async() =>
            {
                await provider.OnSetPropertyValueAsync("InvalidValue", null);
            });
        }