Exemplo n.º 1
0
        public async Task Constructor()
        {
            var provider  = new OutputTypeEnumProvider();
            var generator = await provider.GetProviderAsync(null);

            Assert.NotNull(generator);
        }
Exemplo n.º 2
0
        public async Task TryCreateEnumValue(string input, string expected)
        {
            var provider  = new OutputTypeEnumProvider();
            var generator = await provider.GetProviderAsync(null);

            var value = await generator.TryCreateEnumValueAsync(input);

            Assert.NotNull(value);
            Assert.Equal(expected, value.DisplayName);
        }
Exemplo n.º 3
0
        public async Task GetListedValues()
        {
            var provider  = new OutputTypeEnumProvider();
            var generator = await provider.GetProviderAsync(null);

            var values = await generator.GetListedValuesAsync();

            Assert.Equal(3, values.Count);
            Assert.Equal <string>(new List <string> {
                "0", "1", "2"
            }, values.Select(v => v.DisplayName));
        }